Boost logo

Boost Users :

From: Jeff Garland (jeff_at_[hidden])
Date: 2004-07-21 13:21:44


On Wed, 21 Jul 2004 21:00:00 +0300, Peter Dimov wrote

> > Is there much generic code out there that works only on default
> > constructible objects whose other concept requirements are satisfied
> > by dates?
>
> I can only give one example: serialization.

boost::serialization doesn't require a default and we wrote date_time
serialization code so that it doesn't use the default constructor. Requiring
a default constructor is, however, a weakness of many serialization frameworks...
 
> The real question is: do the benefits (none from my POV) gained by _not_
> supplying a default constructor outweigh the disadvantages?

How about clearer code:

 //what does it do -- non-obvious
 date d;
 std::cout << d << std::endl;

 //obvious...
 date d(not_a_date_time);
 std::cout << d << std::endl;

Personally, that's enough for me...

Jeff


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