
At Tuesday 2004-07-20 14:20, you wrote:
"Jeff Garland"
writes: On Tue, 20 Jul 2004 21:30:04 +0100, Jonathan Oulds wrote
Could anyone explain to me why there is not a default constructor for boost::gregorian::date_time and boost::posix_time::ptime.
Yes, you can see this thread:
http://lists.boost.org/MailArchives/boost-users/msg05864.php
I implemented a simple constructor where both classes are created as 'not_a_date_time'. The only problem I have had is compiling my code on other peoples machines that do not have my modification to the date_time library.
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. if people want not_a_date_time as the value, let 'em use an explicit constructor to say so!
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Victor A. Wagner Jr. http://rudbek.com The five most dangerous words in the English language: "There oughta be a law"