Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-07-21 09:32:08


Victor A. Wagner Jr. wrote:
> At Tuesday 2004-07-20 14:20, you wrote:
>> "Jeff Garland" <jeff_at_[hidden]> writes:
>>
>>> I've given in to user demand -- the default constructor to
>>> not_a_date_time will be in the 1.32 -- gregorian::date same story.
>>
>> Why was that the right choice? It seems like an opportunity for
>> bugs.
>
> seems that way to me also.
> that C polluted the programming world with the default uninitialized
> variables (they really shoulda paid more attention to BCPL, at least
> you had to say = ? if you meant to leave it alone), and C++
> followed (so, purportedly, us 'old farts' would use the language) is
> NO reason to follow down a bad path.

Accessing the value of an unitialized variable is undefined behavior.
Accessing the value of a default-constructed user-defined type is perfectly
defined. Leaving out the default constructor offers little to no benefit to
users.


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