You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to have a base class that handles the creation of the messagepack so that all the derived classes can use it.
class BaseClass
{
public:
msgpack::sbuffer Pack()
{
msgpack::sbuffer buff;
msgpack::pack(buff, *this);
return buff;
}
};
class DerivedClass: public BaseClass
{
public:
MSGPACK_DEFINE_MAP(message);
private:
std::string message;
};
That way I can do
DerivedClass d;
d.Pack();
I will have several classes all deriving from BaseClass so it would be best to have Pack() in that class. However, when I attempt to do this I get this error:
error: no member named 'msgpack_pack' in 'BaseClass'
Is it possible to put just the call to msgpack::pack in a single function that all the types can use?
The text was updated successfully, but these errors were encountered:
I would like to have a base class that handles the creation of the messagepack so that all the derived classes can use it.
That way I can do
I will have several classes all deriving from
BaseClass
so it would be best to havePack()
in that class. However, when I attempt to do this I get this error:Is it possible to put just the call to
msgpack::pack
in a single function that all the types can use?The text was updated successfully, but these errors were encountered: