|
Boost Users : |
Subject: Re: [Boost-users] [Serialization] Non-default constructor and template class
From: Robert Ramey (ramey_at_[hidden])
Date: 2015-06-16 18:01:28
On 6/16/15 1:19 PM, Philipp Münzel wrote:
>
>>
>> you should be able to simply define a private default constructor, if
>> boost::serialization::acess is declared as a friend of your class.
>
> In theory. Current bugs in boost::serialization however then prevent the
> use in a container, for example serializing a std::set<T> where T has a
> private default constructor.
lol - that's not a bug - that's the way it's always been. And it has
nothing to do with serialization of containers per se. The whole concept
of "private function" conflicts with the concept of calling functions
from outside the class. So either one violates the contract implied by
private and implements the constructor outside the class or one respects
the C++ syntax and doesn't try to get around it.
Robert Ramey
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net