|
Boost : |
From: Bruno Martínez Aguerre (br1_at_[hidden])
Date: 2005-03-08 16:34:56
On Tue, 08 Mar 2005 15:42:36 -0500, David Abrahams
<dave_at_[hidden]> wrote:
> "Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> writes:
>
>>> Agreed. I was going to say that an empty optional should print
>>> something, but couldn't articulate the reasons. Thanks.
>>
>> Printing something only for empty optional may lead to unclear output.
>> For
>> example what should be an output of:
>>
>> optional<string> v = "empty";
>> optional<string> v;
>>
>> optional<bool> v = false;
>> optional<bool> v;
>>
>> optional<int> v = 0;
>> optional<int> v;
>
> Nothing. ;-)
>
>> Gennadiy
>
> But seriously, folks, any output is confusible. Just pick a
> sufficiently unlikely placeholder string.
>
How about:
()
(empty)
(false)
(0)
or something similar?
Bruno
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk