Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-03-08 15:42:36


"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.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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