[Boost-bugs] [Boost C++ Libraries] #5436: C++0x patch for boost::unit

Subject: [Boost-bugs] [Boost C++ Libraries] #5436: C++0x patch for boost::unit
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-04-07 10:42:17


#5436: C++0x patch for boost::unit
------------------------------+---------------------------------------------
 Reporter: chrisj | Owner: matthiasschabel
     Type: Patches | Status: new
Milestone: To Be Determined | Component: units
  Version: Boost 1.47.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 The attached patch makes boost::unit work correctly in C++0x, by making
 the code NOT compile when a dimension ordinal is used more than once.

 At the moment this code is only needed in clang's c++0x mode, but it
 doesn't seem to break g++ c++03 or c++0x, so put it all the time.

 The technique currently used (friend functions being double declared)
 doesn't work any more in C++0x, as:

 C++03 says: When a function is defined in a friend function declaration in
 a
 class template, the function is defined at each instantiation of the class
 template. The function is defined even if it is never used.

 C++0x says: When a function is defined in a friend function declaration in
 a
 class template, the function is instantiated when the function is odr-
 used.

 The new technique makes functions with different return values, which
 still causes an error.

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