Opened 12 years ago

Closed 12 years ago

#5436 closed Patches (fixed)

C++0x patch for boost::unit

Reported by: Chris Jefferson Owned by: Matthias Schabel
Milestone: To Be Determined Component: units
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

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.

Attachments (1)

units.patch (588 bytes ) - added by Chris Jefferson 12 years ago.

Download all attachments as: .zip

Change History (2)

by Chris Jefferson, 12 years ago

Attachment: units.patch added

comment:1 by Steven Watanabe, 12 years ago

Resolution: fixed
Status: newclosed

(In [71081]) Fix checking for double registration with clang in C++0x mode. Fixes #5436.

Note: See TracTickets for help on using tickets.