
On Mon, Dec 1, 2008 at 21:05, Christian Holmquist
is_null() What does this mean? Ah, ok, from the docs I see it's a magic uuid (all zero) that is_null. Maybe is_zero() would be more clear?
I also prefer using zero in the name. That said, http://www.faqs.org/rfcs/rfc4122.html calls it the "nil" UUID. But .NET calls it Guid.Empty, and python seems to only call it uuid.UUID(), so nil may not be any clearer. Though really, why not just call it operator unspecified_bool_type? assert(!int() && !shared_ptr<T>() && !uuid());
static uuid create(uuid const& namespace_uuid, char const* name, int name_length); Can this be a generator instead?
std::string name="www.widgets.com"; name_based_generator gen(name.begin(), name.end()); uuid id = gen();
A generator seems logical. I certainly don't like the char*+length version. std::string name="www.widgets.com"; sha1_name_based_generator gen(dns_namespace_uuid); uuid id = gen(name); uuid id2 = gen(name.begin(), name.end()); assert(id == id2) I'd rather know whether it was v3 or v5 somewhere more obvious than the design notes, though. If I were using v3 (MD5) uuids and switched to boost not knowing that v5 (SHA1) uuids exist, I'd likely be very confused when my code stops working with my data.