Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2004-05-21 11:32:24


----- Original Message -----
From: "Pavel Vozenilek" <pavel_vozenilek_at_[hidden]>
> 1. It may be useful to have header with forward
> declarations tribool_fwd.hpp.

Is tribool big enough that it matters? I'm not opposed to having a forward
header, but it seems unnecessary.

> ____________________________________________
> 2. Just thought: shouldn't tribool name be fetched
> via "using" into boost namespace?
>
> I see little chance for possible clashes.

"indeterminate" would also need to be fetched, then. But this is a good
idea.

> ____________________________________________
> 3. docs: the "Home" link on the top is broken.
> Actually all of them.
>
> Links to headers in reference are invalid.
> ____________________________________________

Will be fixed if/when tribool is added to the main tree.

> 4. BOOST_TRIBOOL_THIRD_STATE.html should say
> where (i.e. no namespace of its own) the new name get declared.

Good point!

> An example could be here.

Okay.

> The file name may be lowercased.

That's another BoostBook issue... we could fix it, but it introduces the
possibility of more clashes.

> 5. Question: will tribool play well with
> initialization library? (from Thorsten Ottosen)
> ____________________________________________

Will look into this further.

> 6. swap() member can be added.

Any particular reason? std::swap is as efficient as it gets.

> 7. serialization support (probably non-intrusive
> version) should be added.
>
> Serialization of optional<> can be taken as example.

Okay.

> 8. why is tribool() initialized to false and not
> indeterminate? Some explanation should be in docs.

Because it's meant to mimic a "bool"... you can drop a "tribool" in where
there used to be a "bool" and the semantics won't change unless something
you call can introduce an indeterminate value. This rationale is admittedly
a little weak---I can see reasons for having an indeterminate initial value
as well.

> 9. Silly question: is there way to use ternary operator
> somehow to initialize tribool conditionally:
>
> tribool t(x ? true : indeterminate); // something like that

Unfortunately, I don't know of a way to get the conversions to work out
right for that. If only we could overload the ternary operator :(

> 10 compiling test with Intel C++ 7.0 I get errors:
[snip]
> I get similar errors for VC6.

I'll work on portability.

> 11. Naming nitpick: maybe function
> default_indeterminate_name() would have
> better name get_default_indeterminate_name().

Sure.

    Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk