Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Please provide an example that packs and unpacks a derived class #20

Open
quazar0 opened this issue Apr 30, 2023 · 0 comments
Open

Comments

@quazar0
Copy link

quazar0 commented Apr 30, 2023

Could you please add an example that will pack and unpack a derived class, similar to this class C (which is derived from class P).
And include the proper pack() method in each class.

class C: public P
{
public:
   string sName;

   template< class T >
   void pack( T &pack ) {
      pack( sName, ??? );
   }

}

class P
{
public:
   int uid;

   template< class T >
   void pack( T &pack ) {
      pack( uid );
   }
}

And maybe more importantly, the example should include an example where class C is derived from a std class (e.g. std::map).

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant