Opened 9 years ago

Last modified 9 years ago

#9018 new Bugs

No cross-version constructor

Reported by: Daryle Walker Owned by: Daryle Walker
Milestone: To Be Determined Component: rational
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

I was writing a numeric class template, and it has constructor templates for cross-version conversion. When I tested with two boost::rational instantiations as the component types, the code calls static_cast at the component level, which fails since we never defined that between rational instantiations. (There's the boost::rational_cast function template, but that doesn't help in generic code.) Let's fix that.

We could be fancy and add a non-explicit constructor template for when the component types are implicitly convertible, and an explicit version otherwise, but that would be rude to add C++11 features to a class that's otherwise C++98. Maybe we'll add it someday....

Change History (1)

comment:1 by Daryle Walker, 9 years ago

(In [85484]) Added cross-instantiation constructor template, refs #9018.

Note: See TracTickets for help on using tickets.