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

Add support for boost::optional #122

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

stevehickman
Copy link

Copyright notice is identical to your original wording, with my name there instead.
This should be sufficient to support boost::optional

@AzothAmmo
Copy link
Contributor

Looks pretty much how it should - needs a few minor touch ups (e.g. comments not matching) and unit tests and then it will be good to go. Will likely merge after 1.1 is wrapped up as part of #123 in 1.2.

@stevehickman
Copy link
Author

I’ll get those addressed in the next several days


Steve H.

From: Shane Grant [mailto:[email protected]]
Sent: Monday, September 15, 2014 11:14 AM
To: USCiLab/cereal
Cc: Hickman, Steve (AdvTech)
Subject: Re: [cereal] Add support for boost::optional (#122)

Looks pretty much how it should - needs a few minor touch ups (e.g. comments not matching) and unit tests and then it will be good to go. Will likely merge after 1.1 is wrapped up as part of #123#123 in 1.2.


Reply to this email directly or view it on GitHubhttps://github.com//pull/122#issuecomment-55632890.

Steve Hickman added 3 commits September 15, 2014 11:58
1) Added unit tests for boost_optional support
2) Added unit test to unittest project
3) alphabetized type includes in common.hpp (so it's easier to tell what is being included)

NOTE: project includes reference to boost libraries you may not want to merge in
@stevehickman
Copy link
Author

Unit tests (unittest/boost_optional.cpp) added. Comments cleaned up.


Steve H.

From: Hickman, Steve (AdvTech)
Sent: Monday, September 15, 2014 11:20 AM
To: USCiLab/cereal
Subject: RE: [cereal] Add support for boost::optional (#122)

I’ll get those addressed in the next several days


Steve H.

From: Shane Grant [mailto:[email protected]]
Sent: Monday, September 15, 2014 11:14 AM
To: USCiLab/cereal
Cc: Hickman, Steve (AdvTech)
Subject: Re: [cereal] Add support for boost::optional (#122)

Looks pretty much how it should - needs a few minor touch ups (e.g. comments not matching) and unit tests and then it will be good to go. Will likely merge after 1.1 is wrapped up as part of #123#123 in 1.2.


Reply to this email directly or view it on GitHubhttps://github.com//pull/122#issuecomment-55632890.

@AzothAmmo AzothAmmo added this to the v1.2.0 milestone Sep 29, 2014
@thelink2012
Copy link

It seems to be missing move semantics in some places, such as in the boost::optional load():

optional = val;

would better be

optional = std::move(val);

Anyway pretty cool job you are doing on supporting the boost types!

@AzothAmmo AzothAmmo modified the milestones: v1.2.0, v1.3.0 Sep 28, 2015
}


//! Loading for boost::optional
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should say "boost::compressed_pair", not optional

@patrikhuber
Copy link
Contributor

Not being able to serialise boost::optional bit me today. Do you think this could be merged and integrated into the next release, at least the part about boost::optional? I think optional is probably the most widely used type of all these.

patrikhuber added a commit to patrikhuber/eos that referenced this pull request Feb 17, 2016
Related to last commit: Added serialisation methods for boost::optional. Copied the file from USCiLab/cereal#122, hopefully that pull-request will be accepted.
This commit adds the file to CMakeLists.
@AzothAmmo
Copy link
Contributor

It is something I want to do in the near future but I want to separate out serialization code for external libraries from the core of cereal, so it won't make the next immediate release but is targeted for the one after that.

@patrikhuber
Copy link
Contributor

@AzothAmmo I do agree with you. However, don't you think boost::optional specifically is worthy of being included directly? It's pretty much "core functionality", widely used and will probably even make it into the standard soon. I see boost_variant in the included types as well ;-) But I see your point, I can also just copy the header from here over into my project.

@AzothAmmo
Copy link
Contributor

Well we can always bring it in and then push it out to a different place once we do modules.

@patrikhuber
Copy link
Contributor

I would (of course) leave the decision up to you. I can offer to prepare a PR. I just figured however since I include the cereal headers in my projects directly (and not via submodule or external module or something), it actually doesn't really make a difference and I can just include the file for optional in my projects. I'm OK with either.

@stevehickman
Copy link
Author

Per instructions on the web site, I've now made this and other updates on the current develop branch and submitted a new pull request. See PR #282

@joshhaines
Copy link

It would be awesome to get this merged into the next version. If there's anything I can do to help, let me know. I had to fork Cereal and pull in this boost stuff (along with a tweak to get Cereal working with Android). However, it would be awesome if this was officially supported.

@stevehickman
Copy link
Author

I'll get the boost support synched with the latest develop branch this weekend.

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

Successfully merging this pull request may close these issues.

5 participants