Subject: [Boost-bugs] [Boost C++ Libraries] #11087: Converting assignment operator is too generous
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-09 08:37:52
#11087: Converting assignment operator is too generous
------------------------------+-----------------------
Reporter: anonymous | Owner: fcacciola
Type: Bugs | Status: new
Milestone: To Be Determined | Component: optional
Version: Boost 1.57.0 | Severity: Problem
Keywords: |
------------------------------+-----------------------
This has been reported by Karol Nowacki. The following program compiles
although it shoudl not.
{{{
#include <boost/optional.hpp>
enum E1 {e1};
enum E2 {e2};
int main()
{
boost::optional<E2> o2(e2);
boost::optional<E1> o1;
o1 = o2; // SHOULD NOT WORK
}
}}}
It should not compile given that the following do not compile:
{{{
E1 v1 = e2; // FAILS
E1 v1_;
v1_ = e2; // FAILS
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11087> 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-16 18:50:18 UTC