Code Monkey home page Code Monkey logo

Comments (4)

AzothAmmo avatar AzothAmmo commented on July 16, 2024

Are you compiling the develop branch of the code? We haven't merged the changes into master yet. VS2012 will likely never be supported.

from cereal.

DrAWolf avatar DrAWolf commented on July 16, 2024

Ah, shame on me. I messed up the versions.
Your development branch plus the latest boost trunk (1.55) => works like a charm

from cereal.

AzothAmmo avatar AzothAmmo commented on July 16, 2024

Good to hear. I'm hoping to finish up the remaining open issues and merge everything into a new release fairly soon.

from cereal.

DrAWolf avatar DrAWolf commented on July 16, 2024

you might consider including the following macros for user convenience
...I use them all the time...

the user does not need to remember the serialize template function
all he has to do is list the desired member variables:

class MyClass
{

 int x1;
 double d;

 AW_SERIALIZE_MEMBERS( x1, d );

};

#define AW_SERIALIZE_MEMBERS( ...
)
friend class
cereal::access;
template
void serialize( Archive& archive
)
{
archive( AW_MAKENVPS( VA_ARGS )
);
} \

for derived classes you could define

#define AW_SERIALIZE_BASE_CLASS_AND_MEMBERS( base, ...
)
friend class
cereal::access;
template
void serialize( Archive& archive
)
{
archive( cereal::make_nvp( #base, cereal::base_class(
this ) ) );
archive( AW_MAKENVPS( VA_ARGS )
);
} \

under the hood, I am still using some macro tricks (which might or might
not be obsolete with c++11)

#define AW_NVP AW_MAKENVPS

#define _NVP( _name, _class ) cereal::make_nvp( _name, _class )

#define AW_MAKENVPS( ... ) _EXPAND_VA_ARGS( AW_CONCAT( _AW_MAKENVPS,
AW_NUMARGS( VA_ARGS ) )( VA_ARGS ) )

#define _AW_MAKENVPS0
#define _AW_MAKENVPS1( A ) _NVP( #A, A )
#define _AW_MAKENVPS2( A,B ) _NVP( #A, A ), _NVP( #B, B )
#define _AW_MAKENVPS3( A,B,C ) _NVP( #A, A ), _NVP( #B, B ), _NVP( #C, C )
...

from cereal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.