Boost logo

Boost :

Subject: Re: [boost] Nullable types
From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2013-07-15 01:24:13


The std::optional proposed for C++14 uses std::nullopt and it was purposely
kept separate from any other nulls because of implicit conversion.

If you put a tribool into a optional then set it to some_common_null, are
you setting the optional to null/disengaged or setting the tribool to
indeterminate (and the optional is thus engaged).

ie:

optional<tribool> op = some_null;

Sure an optional tribool is odd (in effect a quadbool) but probably will
happen somewhere, and not obvious if it happens in templates...

Tony

Sent from my portable Analytical Engine

------------------------------
*From:* "Bjorn Reese" <breese_at_[hidden]>
*To:* "boost_at_[hidden]" <boost_at_[hidden]>
*Sent:* 13 July, 2013 8:58 AM
*Subject:* [boost] Nullable types

It seems like different Boost libraries use different nullable types.

   * Optional uses boost::none
   * Tribool uses boost::logic::indeterminate_keyword_t
   * Tuple uses boost::tuples::null_type
   * Variant uses boost::blank

And there are possibly more.

What are your opinions about unifying these?

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


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