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

When serializing, pass archive flags to traits::get_type_size #1451

Merged
merged 1 commit into from Apr 7, 2015

Conversation

biddisco
Copy link
Contributor

@biddisco biddisco commented Apr 7, 2015

This allows specializations for classes like serialization_buffer
to return a different size depending on whether zero_copy is
enabled or not.

This allows specializations for classes like serialization_buffer
to return a different size depending on whether zero_copy is
enabled or not.
@biddisco
Copy link
Contributor Author

biddisco commented Apr 7, 2015

@hkaiser : I've corrected the patch (argument spacing) and replaced it with the new one. I'd be grateful if you could closely check what I've done in type_size.hpp ~ line 125 (bind(accumulate(...)) and make sure it is correct.

@hkaiser
Copy link
Member

hkaiser commented Apr 7, 2015

@hkaiser : I've corrected the patch (argument spacing) and replaced it with the new one. I'd be grateful if you could closely check what I've done in type_size.hpp ~ line 125 (bind(accumulate(...)) and make sure it is correct.

That code looks fine, even if (for my taste) using bind() for this seems like a bit of an overkill. A lambda or an explicit member in get_size() would do the same with less clutter.

@hkaiser
Copy link
Member

hkaiser commented Apr 7, 2015

LGTM! Thanks!

@K-ballo
Copy link
Member

K-ballo commented Apr 7, 2015

@hkaiser : I've corrected the patch (argument spacing) and replaced it with the new one. I'd be grateful if you could closely check what I've done in type_size.hpp ~ line 125 (bind(accumulate(...)) and make sure it is correct.

That code looks fine, even if (for my taste) using bind() for this seems like a bit of an overkill. A lambda or an explicit member in get_size() would do the same with less clutter.

Not a lambda, that's a polymorphic callable and that would require C++14. A raw member would certainly be simpler, somewhat uglier but I think an overall win over bind.

hkaiser added a commit that referenced this pull request Apr 7, 2015
When serializing, pass archive flags to traits::get_type_size
@hkaiser hkaiser merged commit bc55720 into master Apr 7, 2015
@hkaiser hkaiser deleted the fixing_1450 branch April 7, 2015 17:28
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.

None yet

3 participants