Re: [Boost-bugs] [Boost C++ Libraries] #2938: [operators] BOOST_OPERATOR2_LEFT prevents builtin types from being used as first template parameter

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2938: [operators] BOOST_OPERATOR2_LEFT prevents builtin types from being used as first template parameter
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-04-18 09:10:09


#2938: [operators] BOOST_OPERATOR2_LEFT prevents builtin types from being used as
first template parameter
-----------------------------------------------+----------------------------
  Reporter: Arne Mertz <boost_at_[hidden]> | Owner: daniel_frey
      Type: Bugs | Status: closed
 Milestone: Boost 1.39.0 | Component: operators
   Version: Boost 1.38.0 | Severity: Problem
Resolution: invalid | Keywords:
-----------------------------------------------+----------------------------
Changes (by daniel_frey):

  * status: new => closed
  * resolution: => invalid

Comment:

 I assume that by BOOST_NO_NRVO you mean BOOST_HAS_HRVO. First question:
 Does setting BOOST_FORCE_SYMMETRIC_OPERATORS solves your problem?

 The documentation is not too clear on builtin types, but the "usual" use-
 case is, that the first parameter of the operator templates is a UDT. From
 the docs:

 "When applying the two-argument form of a template, the desired return
 type of the operators typically determines which of the two types in
 question should be derived from the operator template. For example, if the
 result of T + U is of type T, then T (not U) should be derived from
 addable<T, U>. "

 Of course there is "typically" and "should" in there and the requirement
 tables later in the docs only says "temp" but doesn't exactly say that
 "temp" could be a temporary. In fact, it leaves the impression that "temp"
 is always from an expression like "T temp(u)" which makes it a normal
 variable, not a real temporary.

 I added a note to the docs to point out that the type T (the first
 template argument) may not be a builtin type and I'll close this ticket.
 If you don't agree (and if setting BOOST_FORCE_SYMMETRIC_OPERATORS doesn't
 work for you or is not a satisfying solution), feel free to ask on the
 boost-devel list so we can discuss if and how builtin types could be
 supported.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2938#comment:1>
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:00 UTC