diff --git a/src/google/protobuf/generated_message_reflection.cc b/src/google/protobuf/generated_message_reflection.cc index 436856f57c..052f9d7417 100644 --- a/src/google/protobuf/generated_message_reflection.cc +++ b/src/google/protobuf/generated_message_reflection.cc @@ -1168,6 +1168,14 @@ void Reflection::SwapFieldsImpl( } } +template void Reflection::SwapFieldsImpl( + Message* message1, Message* message2, + const std::vector& fields) const; + +template void Reflection::SwapFieldsImpl( + Message* message1, Message* message2, + const std::vector& fields) const; + void Reflection::SwapFields( Message* message1, Message* message2, const std::vector& fields) const { diff --git a/src/google/protobuf/message.h b/src/google/protobuf/message.h index 0ce0218df9..fb0643c3d8 100644 --- a/src/google/protobuf/message.h +++ b/src/google/protobuf/message.h @@ -1308,6 +1308,14 @@ class PROTOBUF_EXPORT Reflection final { internal::ParseContext* ctx); }; +extern template void Reflection::SwapFieldsImpl( + Message* message1, Message* message2, + const std::vector& fields) const; + +extern template void Reflection::SwapFieldsImpl( + Message* message1, Message* message2, + const std::vector& fields) const; + // Abstract interface for a factory for message objects. // // The thread safety for this class is implementation dependent, see comments