I'm pretty new to "msgpack". I'm trying to pack the user-defined class:
MyClass::Pack()
{
msgpack::sbuffer sbuf;
msgpack::pack(sbuf, this);
}
But compiler (VC 9.0) says me
error C2228: left of '.msgpack_pack' must have class/struct/union third_party\msgpack\include\msgpack\object.hpp 218
The only way I've found:
MyClass::Pack()
{
MyClass copy(this);
msgpack::sbuffer sbuf;
msgpack::pack(sbuf, copy);
}
But what if I don't want to make a copy (e.g. it is heavy operation or requires many additional resources)? Can I do this without a copy ctor? Thanks.