Suggestion: move cereal::make_nvp and NamedValuePair class to it's own headers
65 views
Skip to first unread message
Viktor Sehr
unread,
Jan 7, 2019, 8:03:31 AM1/7/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cereal serialization library
This, of course, in order to reduce compile times. As most classes only required the template function load/save/serialize but require cereal::make_nvp, its superflous to include the whole of cereal.hpp.
Only the actual function (make_nvp) and the base (NamedValuePair<>) is most often required.
/Viktor
Julius Rapp
unread,
Feb 21, 2019, 12:47:00 PM2/21/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cereal serialization library
[...] its superflous to include the whole of cereal.hpp.
Only the actual function (make_nvp) and the base (NamedValuePair<>) is most often required.
I also dislike the requirement to include cereal/cereal.hpp just for using make_nvp. For me, the problem is the dependency on cereal that propagates to all users of the serializable class. In fact, I wished that a templated serialization function in a header file did not depend on cereal at all. This can be achieved by using argument-dependent lookup and it requires only tiny additions to the cereal codebase. I have created an incomplete pull request in order to demonstrate my wish and to get some feedback on this.