[Boost-bugs] [Boost C++ Libraries] #3395: Assignment to optional is not possible if operator& is overriden

Subject: [Boost-bugs] [Boost C++ Libraries] #3395: Assignment to optional is not possible if operator& is overriden
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-03 06:46:07


#3395: Assignment to optional is not possible if operator& is overriden
---------------------------------+------------------------------------------
 Reporter: andysem | Owner: fcacciola
     Type: Bugs | Status: new
Milestone: Boost 1.41.0 | Component: optional
  Version: Boost 1.40.0 | Severity: Problem
 Keywords: optional assignment |
---------------------------------+------------------------------------------
 The assignment operator for optional< T > uses T::operator& to dispatch
 the call between assign_expr functions. This dispatch breaks if the
 T::operator& returns something else than T*. This is the case with ATL
 types, such as CComBSTR.

 The suggested fix is to replace call to operator& with addressof. Please,
 find the attached patch against the 1.40 release.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3395>
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:01 UTC