Opened 9 years ago

Last modified 9 years ago

#9722 new Bugs

Changeset 55698 Problem with "base_unit_info<S>::name());"

Reported by: Eckhard Nees <eckhard.nees@…> Owned by: Matthias Schabel
Milestone: To Be Determined Component: units
Version: Boost 1.55.0 Severity: Problem
Keywords: base_unit_info name symbol Cc: Steven Watanabe

Description

In the Changeset 55698 in Line 85 the return(Scale::name() + S::name()); was changed to return(Scale::name() + base_unit_info<S>::name());

Now I get the compiler-error /opt/local/include/boost/units/scaled_base_unit.hpp:85:32: Implicit instantiation of undefined template 'boost::units::base_unit_info<boost::units::cgs::gram_base_unit>'

when I try to get the name of a scaled unit:

boost::units::si::kilogram_base_unit kg; std::string strKg{kg.name()};

When I change line 85 back to the original version, the binding results and the output is correct.

The same is valid for line 81 "symbol".

Possible solution: go back to the former version. Side effects?

or add in gram.hpp in line 36

template<> struct base_unit_info<cgs::gram_base_unit> {

static const char* name() { return("gram"); } static const char* symbol() { return("g"); }

};

but results in double definitions of name and symbol. The same has to be repeated for the other base_units, e.g. centimeter_base_unit

Change History (1)

comment:1 by Steven Watanabe, 9 years ago

The default definition of base_unit_info is in io.hpp. You can #include this for now, until I get around to refactoring the headers.

Note: See TracTickets for help on using tickets.