|
Boost Users : |
From: Serge Skorokhodov (serge.skorokhodov_at_[hidden])
Date: 2005-08-05 09:24:43
Hi,
>> Still, why do not make it user configurable? Now I (and some
>> others of course:) have to write a wrapper to use tribool
>> for my purposes and (if undetermined were the default)
>> somebody else will need the same. I don't believe that it is
>> possible to satisfy everybody adding "null flavors".
>
>
> How would you make it configurable? Macros? A static "tribool"
> value somewhere that is used for initialization?
>
Well, I agree that it can get rather ugly...:) Just for example:
class indetermined_uninitialized{};
class indetermined_value_not_possible{};
class indetermined_something_else_i_cannot_think_of_right_now{};
template <class flawor>
tribool { ... };
typedef tribool<indetermined_uninitialized> tribool_with_null_flavor;
...
What seems important to me, partial specialization can have
specialized logical operators that support semantics of using
bools when some of the operands is unknown, impossible etc. More
over, it will be possible to create even more unbelievable
customized versions...:)
Summing up, I believe that the whole story relates to notion of
values with null flavors. And it is not just bool values that may
need multiple null flawors...
Do not punish me, though. It's just a proposal...:)
-- Serge
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