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
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
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.

Julius
Reply all
Reply to author
Forward
0 new messages