Could someone help me figure this error C2663: MediaSetting::mutable_mediamessage: 2 overloads have no legal conversion for this pointer
happened, when mutable_mediamessage()
is called in the following codes.
class MediaSetting : public ::google::protobuf::Message {
public:
inline ::MSG::MediaMessage* mutable_mediamessage(int index);
inline ::google::protobuf::RepeatedPtrField< ::MSG::MediaMessage >* mutable_mediamessage();
}
inline ::MSG::MediaMessage* MediaSetting::mutable_mediamessage(int index) {
return mediamessage_.Mutable(index);
}
inline ::google::protobuf::RepeatedPtrField< ::MSG::MediaMessage >*
MediaSetting::mutable_mediamessage() {
return &mediamessage_;
}
// my test codes
// ...
const ::MSG::MediaSetting& media = config.mediasetting();
::google::protobuf::RepeatedPtrField<::MSG::MediaMessage>* pmedia = media.mutable_mediamessage(); // Error C2663 is here
Environment: VS2008
You are attempting to access a non-const member function via a const reference.