How do I pass protobuf's boost::shared_ptr pointer to function?
问题 I have to pass a boost::shared_ptr : boost::shared_ptr<Protobuf::Person::Profile> pProfile = boost::make_shared<Protobuf::Person::Profile>(); which is protobuf's pointer, to a protobuf's function oPerson.set_allocated_profile(pProfile) but oPerson.set_allocated() expects a pointer to Protobuf::Person::Profile . I have tried couple of ways but I think when I try to convert protobuf object to JSON using pbjson::pb2Json which is a library function built on rapid json, the pointer goes out of