Boost logo

Boost :

Subject: Re: [boost] [optional] Safe optional
From: Bjorn Reese (breese_at_[hidden])
Date: 2014-11-20 11:13:24


On 11/20/2014 11:49 AM, Andrzej Krzemienski wrote:

> The user-provided int can be any value of int plus the situation where user
> decides not to type any input. the latter is a valid and useful
> information. E.g. when an int represents some threshold, having boost::none
> means "go with no threshold". boost::none is just a value. this in turn
> implies the implicit conversions:
>
> optional<int>() != 2;
>
> The above is logical and useful, even outside of the containers.

As optional is a nullable type, it could be useful to let the comparison
operators return a tri-bool instead of a bool.


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