Subject: [Boost-bugs] [Boost C++ Libraries] #2248: BLL constifies return values of operator*
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-08-23 15:28:14
#2248: BLL constifies return values of operator*
----------------------------------------------------+-----------------------
Reporter: thomas weidner <thomas_weidner_at_[hidden]> | Owner: no-maintainer
Type: Bugs | Status: new
Milestone: Boost 1.37.0 | Component: lambda
Version: Boost 1.36.0 | Severity: Problem
Keywords: |
----------------------------------------------------+-----------------------
Hi, the problem can quickly described as
{{{
( *_1 = 0 ) ( shared_ptr<int>(new int) );
// vs
( *_1 = 0) ( new int );
}}}
only the second line compiles. I tracked down the problem to
boost/lambda/operator_return_type_traits.hpp:230. The BLL sets the return
type of (const shared_ptr<int>)::operator*() to be const int& rather than
int&. This is like turning int * const into int const *. I (and others)
don't see a reason for this specialization, the code above works with the
specialization removed.
-- Ticket URL: <http://svn.boost.org/trac/boost/ticket/2248> 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:49:58 UTC