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
Conversation
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
f15975d
to
6335a35
Compare
{ | ||
static std::size_t size(file_wrapper const& cont) | ||
{ | ||
return cont.size(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT!