Opened 9 years ago
Last modified 9 years ago
#9722 new Bugs
Changeset 55698 Problem with "base_unit_info<S>::name());"
Reported by: | 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
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.