|
Boost Users : |
Subject: Re: [Boost-users] [Review] UUID library (mini-)review starts today, November 23rd
From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2008-12-03 01:11:02
On Wed, Dec 3, 2008 at 00:21, muhammadchang <kennethlaskoski_at_[hidden]> wrote:
>
> First of all, my opinion is that this kind of classes, sometimes called
> concrete types, are the very plus plus suggested by the language's name. A
> well designed user type behaves and cost, exactly the same as any built in
> type. [...] In particular, I don't like
> the "default null constructor". For me, the default constructor MUST
> generate a valid object, period. I have already copied/used Andy's code,
> which I luckily found in your vault, and one thing I changed was this
> default constructor [uuid_t uuid; // generates a valid random uuid].
"behaves and cost, exactly the same as any built in type" and the
"default constructor [...] generates a valid random uuid" seem rather
opposed. int() is not a random int, it's 0. No fundamental type --
no standard library type either, that I can think of -- has T() !=
T(), yet you want uuid() != uuid().
And why is the random UUID generator deemed more important than the
time-based one, so much so that it gets the default constructor?
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