Boost logo

Boost Users :

From: George A. Heintzelman (georgeh_at_[hidden])
Date: 2002-12-27 11:45:44


> Right, this will do it. I think I shall pursue this way.
> However, date is quite a low-level class, and it sounds perfectly
> reasonable to create a vector of dates.

> My opinion is that ability to create vectors is a strong argument for
> providing default constructor; it is not really that important what
> exact value it sets date to, as long as it is not a regular date. I
> personally have a slight preference for not_a_date.

Um, you can create a std::vector of a non-default-constructible object.
It needs to be CopyConstructible, not DefaultConstructible. The only
issue is that occasionally you may need to pass in a default
initializer (e.g., when resizing (not reserving) or push_back-ing with
no argument).

Now, whether a date should nevertheless be default-constructible is
another issue, but simply being able to put them in a vector is not an
argument for it.

George Heintzelman
georgeh_at_[hidden]


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