Re: [Boost-bugs] [Boost C++ Libraries] #12788: optional 1.63 no longer can be initialized from '<brace-enclosed initializer list>'

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12788: optional 1.63 no longer can be initialized from '<brace-enclosed initializer list>'
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-02-24 13:37:41


#12788: optional 1.63 no longer can be initialized from '<brace-enclosed
initializer list>'
-------------------------------+----------------------
  Reporter: piotrwn1@… | Owner: akrzemi1
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: optional
   Version: Boost 1.63.0 | Severity: Problem
Resolution: invalid | Keywords:
-------------------------------+----------------------
Changes (by akrzemi1):

 * cc: akrzemi1 (added)
 * status: assigned => closed
 * resolution: => invalid

Comment:

 This breakage is intentional.

 In fact the previous behavior was inconsistent with `std::optional` and
 error-prone. Braces should deduce type `optional<T>`, not to `T`. For more
 details of why it was confusing, see here:
  http://stackoverflow.com/questions/40391244/difference-between-boost-
 optional-and-stdexperimental-optional-assignment/40677193#40677193

 Now the following puts the optional into no-value state:

 {{{
 boost::optional<S> so;
 so = {};
 }}}

 Just like `std::optional`.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12788#comment:5>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-24 13:41:18 UTC