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

Unify access_data trait for use in both, serialization and de-serialization #2658

Merged
merged 7 commits into from Jun 9, 2017

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented May 29, 2017

  • adding daft example demonstrating the use of this trait for writing/reading to a file

…zation

- adding daft example demonstrating the use of this trait for writing/reading to a file
@hkaiser hkaiser force-pushed the serialization_access_data branch from f15975d to 6335a35 Compare June 1, 2017 18:53
{
static std::size_t size(file_wrapper const& cont)
{
return cont.size();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this function return cont.size_data() if "size_data()" was defined in file_wrapper?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, if the name of the corresponding function exposed by the file_wrapper type is renamed as well... But why?

Copy link
Contributor

Choose a reason for hiding this comment

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

In this context I do not need the size of my entire container but just of a portion of it aka the "data" portion. I would prefer to be able to have two functions .size() and .size_data() that my object exposes.

Copy link
Contributor

@aserio aserio left a comment

Choose a reason for hiding this comment

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

LGMT!

@aserio aserio merged commit b93abd7 into master Jun 9, 2017
@hkaiser hkaiser deleted the serialization_access_data branch June 9, 2017 13:52
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

2 participants