Subject: [Boost-bugs] [Boost C++ Libraries] #12708: Cannot use Boost Units cmath.hpp with custom systems
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-12-22 08:11:53
#12708: Cannot use Boost Units cmath.hpp with custom systems
-----------------------------------------------+---------------------------
Reporter: Kamil Rojewski <kamil.rojewski@â¦> | Owner:
Type: Bugs | matthiasschabel
Milestone: To Be Determined | Status: new
Version: Boost 1.62.0 | Component: units
Keywords: | Severity: Problem
-----------------------------------------------+---------------------------
When creating a new, custom unit sustem in Boost Units using
boost::units::make_system, there's an issue when including cmath.hpp:
{{{
In file included from boost/boost/units/cmath.hpp:29:
In file included from boost/boost/units/systems/si/plane_angle.hpp:14:
In file included from boost/boost/units/systems/si/base.hpp:20:
In file included from boost/boost/units/base_units/si/meter.hpp:17:
/boost/boost/units/base_unit.hpp:108:9: error: functions that differ only
in their return type cannot be overloaded
check_double_register(const units::base_unit_ordinal<N>&)
^
Common/Units.h:26:15: note: in instantiation of template class
'boost::units::base_unit<VA::Units::SquareBaseUnit,
boost::units::list<boost::units::dim<boost::units::length_base_dimension,
boost::units::static_rational<1, 1> >,
boost::units::dimensionless_type>, -9, void>' requested here
: boost::units::base_unit<SquareBaseUnit,
boost::units::length_dimension, -9>
^
boost/boost/units/base_unit.hpp:108:9: note: previous declaration is here
check_double_register(const units::base_unit_ordinal<N>&)
^
boost/boost/units/base_unit.hpp:114:9: error: redefinition of
'boost_units_unit_is_registered'
}}}
As you can see, cmath includes the full si system and you cannot make your
own after that.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12708> 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:20 UTC