![]() |
Home | Libraries | People | FAQ | More |
boost::units::quantity — class declaration
// In header: <boost/units/quantity.hpp> template<typename Unit, typename Y> class quantity { public: // types typedef quantity< Unit, Y > this_type; typedef Y value_type; typedef Unit unit_type; // construct/copy/destruct quantity(); quantity(unspecified_null_pointer_constant_type); quantity(const this_type &); template<typename YY> quantity(const quantity< Unit, YY > &, unspecified = 0); template<typename YY> explicit quantity(const quantity< Unit, YY > &, unspecified = 0); template<typename YY> quantity(const quantity< Unit, YY > &); template<typename Unit2, typename YY> explicit quantity(const quantity< Unit2, YY > &, unspecified = 0); template<typename Unit2, typename YY> quantity(const quantity< Unit2, YY > &, unspecified = 0); template<typename Unit2, typename YY> explicit quantity(const quantity< Unit2, YY > &); explicit quantity(const value_type &, int); BOOST_CXX14_CONSTEXPR this_type & operator=(const this_type &); template<typename YY> BOOST_CXX14_CONSTEXPR this_type & operator=(const quantity< Unit, YY > &); template<typename Unit2, typename YY> BOOST_CXX14_CONSTEXPR this_type & operator=(const quantity< Unit2, YY > &); ~quantity(); // private member functions BOOST_MPL_ASSERT_NOT(unspecified); // public member functions template<typename Unit2, typename YY> BOOST_CXX14_CONSTEXPR this_type & operator-=(const quantity< Unit2, YY > &); template<typename Unit2, typename YY> BOOST_CXX14_CONSTEXPR this_type & operator*=(const quantity< Unit2, YY > &); BOOST_CXX14_CONSTEXPR this_type & operator/=(const value_type &); // public static functions static BOOST_CONSTEXPR this_type from_value(const value_type &); };
quantity
public
construct/copy/destructquantity();
quantity(unspecified_null_pointer_constant_type);
quantity(const this_type & source);
template<typename YY> quantity(const quantity< Unit, YY > & source, unspecified = 0);implicit conversion between value types is allowed if allowed for value types themselves
template<typename YY> explicit quantity(const quantity< Unit, YY > & source, unspecified = 0);implicit conversion between value types is not allowed if not allowed for value types themselves
template<typename YY> quantity(const quantity< Unit, YY > & source);implicit conversion between value types is allowed if allowed for value types themselves
template<typename Unit2, typename YY> explicit quantity(const quantity< Unit2, YY > & source, unspecified = 0);explicit conversion between different unit systems is allowed if implicit conversion is disallowed
template<typename Unit2, typename YY> quantity(const quantity< Unit2, YY > & source, unspecified = 0);implicit conversion between different unit systems is allowed if each fundamental dimension is implicitly convertible
template<typename Unit2, typename YY> explicit quantity(const quantity< Unit2, YY > & source);
without SFINAE we can't distinguish between explicit and implicit conversions so the conversion is always explicit
explicit quantity(const value_type & val, int);
BOOST_CXX14_CONSTEXPR this_type & operator=(const this_type & source);
template<typename YY> BOOST_CXX14_CONSTEXPR this_type & operator=(const quantity< Unit, YY > & source);implicit assignment between value types is allowed if allowed for value types themselves
template<typename Unit2, typename YY> BOOST_CXX14_CONSTEXPR this_type & operator=(const quantity< Unit2, YY > & source);implicit assignment between different unit systems is allowed if each fundamental dimension is implicitly convertible
~quantity();
quantity
public member functionstemplate<typename Unit2, typename YY> BOOST_CXX14_CONSTEXPR this_type & operator-=(const quantity< Unit2, YY > & source);
template<typename Unit2, typename YY> BOOST_CXX14_CONSTEXPR this_type & operator*=(const quantity< Unit2, YY > & source);
BOOST_CXX14_CONSTEXPR this_type & operator/=(const value_type & source);