[Boost-bugs] [Boost C++ Libraries] #9722: Changeset 55698 Problem with "base_unit_info<S>::name()); "

Subject: [Boost-bugs] [Boost C++ Libraries] #9722: Changeset 55698 Problem with "base_unit_info<S>::name()); "
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-02-28 09:42:11


#9722: Changeset 55698 Problem with "base_unit_info<S>::name());"
-------------------------------------------+-----------------------------
 Reporter: Eckhard Nees <eckhard.nees@…> | Owner: matthiasschabel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: units
  Version: Boost 1.55.0 | Severity: Problem
 Keywords: base_unit_info name symbol |
-------------------------------------------+-----------------------------
 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

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