Re: [Boost-users] optional + serialize
Hi Robert! thanks for the reply. I've to agree with you that my solution to problem was an ugly hack. It certainly is very inefficient and not exception safe. Furthermore it requires T::operator=. I took a look at the file you mentioned. But unfortunately I lack the knowledge of boost internals and, more important, I'm unfamiliar with the highly advanced c++ stuff, like inplace new or however the collection stuff is done. Therefore I, unfortunately, cannot suggest a better solution. I guess I've to bear with that performance hit, for now. I hope s.o. with better boost knowledge than me will address this issue in a future version. kind regards Alex
-----Ursprüngliche Nachricht----- Von: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org]Im Auftrag von Robert Ramey Gesendet: Donnerstag, 4. August 2005 01:49 An: boost-users@lists.boost.org Betreff: Re: [Boost-users] optional + serialize
a) I've read your post b) I see your point that the serialization of optional doesn't handle types without default constructors c) I agree that it should be fixed. d) don't like the way you fixed it. I'm sure should work but I don't like the usage of the heap. For a better way to do this take a look at collections_load_imp.hpp which adderss this problem in a different context.
Its too late to fixe for 1.33.
Robert Ramey
Jasper, Alexander wrote:
Hi Jeff, All!
thanks a lot for the reply. I assume the bug fix is in 1.33?
I'm still having issues with boost.optinal and boost.serialize working together (in 1.32). Is for deserialization of boost::optional<T> T required to have default ctor?.
This prevents boost::optionalboost::posix_time::time_period from being serialized. The extraction code fails to compile. I would an ugly way around this (please see my last email). Does anybody have ideas for better solutions?
I've attached a modified version of #include
to this email, that contains code changes to make to work with types w/o T having a default ctor. But I'm really unhappy with that solution and I don't know what I broke with this change... thanks in advance
Alex
-----Ursprüngliche Nachricht----- Von: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org]Im Auftrag von Jeff Garland Gesendet: Freitag, 29. Juli 2005 15:40 An: boost-users@lists.boost.org Betreff: Re: [Boost-users] questions concerning optional + date_time +serialize
On Fri, 29 Jul 2005 15:21:38 +0200, Jasper, Alexander wrote
... Another thing is that I'm unable to serialize not_a_date_time ptimes. The extractions fails here. I'm using the binary archive. Is that supported? The documentation of date time only states compatibility with text and XML archive...
There was a recent (jun 21) bug-fix in date-time that was preventing correct serialization of special values -- even with text archives -- so it's likely that's what you are seeing. I haven't tried the binary archive, but there's no reason it shouldn't work. I believe you should be able to just pickup the latest version of gregorian/greg_serialize.hpp and posix_time/time_serialize.hpp to try it out.
Jeff _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (1)
-
Jasper, Alexander