Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::units::quantity< Unit, Y > Singleton Reference

class declaration More...

#include <units_fwd.hpp>

Public Types

typedef quantity< Unit, Y > this_type
 
typedef Y value_type
 
typedef Unit unit_type
 

Public Member Functions

 quantity ()
 
 quantity (unspecified_null_pointer_constant_type)
 
 quantity (const this_type &source)
 
this_typeoperator= (const this_type &source)
 
template<class YY >
 quantity (const quantity< Unit, YY > &source, typename boost::enable_if< detail::is_non_narrowing_conversion< YY, Y > >::type *=0)
 implicit conversion between value types is allowed if allowed for value types themselves More...
 
template<class YY >
 quantity (const quantity< Unit, YY > &source, typename boost::disable_if< detail::is_non_narrowing_conversion< YY, Y > >::type *=0)
 implicit conversion between value types is not allowed if not allowed for value types themselves More...
 
template<class YY >
this_typeoperator= (const quantity< Unit, YY > &source)
 implicit assignment between value types is allowed if allowed for value types themselves More...
 
template<class Unit2 , class YY >
 quantity (const quantity< Unit2, YY > &source, typename boost::disable_if< mpl::and_< typename is_implicitly_convertible< Unit2, Unit >::type, detail::is_non_narrowing_conversion< YY, Y > >, typename detail::disable_if_is_same< Unit, Unit2 >::type >::type *=0)
 explicit conversion between different unit systems is allowed if implicit conversion is disallowed More...
 
template<class Unit2 , class YY >
 quantity (const quantity< Unit2, YY > &source, typename boost::enable_if< mpl::and_< typename is_implicitly_convertible< Unit2, Unit >::type, detail::is_non_narrowing_conversion< YY, Y > >, typename detail::disable_if_is_same< Unit, Unit2 >::type >::type *=0)
 implicit conversion between different unit systems is allowed if each fundamental dimension is implicitly convertible More...
 
template<class Unit2 , class YY >
this_typeoperator= (const quantity< Unit2, YY > &source)
 implicit assignment between different unit systems is allowed if each fundamental dimension is implicitly convertible More...
 
const value_typevalue () const
 constant accessor to value More...
 
template<class Unit2 , class YY >
this_typeoperator+= (const quantity< Unit2, YY > &source)
 can subtract a quantity of the same type if subtract_typeof_helper<value_type,value_type>::type is convertible to value_type More...
 
template<class Unit2 , class YY >
this_typeoperator-= (const quantity< Unit2, YY > &source)
 
template<class Unit2 , class YY >
this_typeoperator*= (const quantity< Unit2, YY > &source)
 
template<class Unit2 , class YY >
this_typeoperator/= (const quantity< Unit2, YY > &source)
 can multiply a quantity by a scalar value_type if multiply_typeof_helper<value_type,value_type>::type is convertible to value_type More...
 
this_typeoperator*= (const value_type &source)
 can divide a quantity by a scalar value_type if divide_typeof_helper<value_type,value_type>::type is convertible to value_type More...
 
this_typeoperator/= (const value_type &source)
 

Static Public Member Functions

static this_type from_value (const value_type &val)
 Construct quantity directly from value_type (potentially dangerous). More...
 

Protected Member Functions

 quantity (const value_type &val, int)
 

Detailed Description

template<class Unit, class Y>
singleton boost::units::quantity< Unit, Y >

class declaration

Member Typedef Documentation

template<class Unit, class Y>
typedef quantity<Unit,Y> boost::units::quantity< Unit, Y >::this_type
template<class Unit, class Y>
typedef Unit boost::units::quantity< Unit, Y >::unit_type
template<class Unit, class Y>
typedef Y boost::units::quantity< Unit, Y >::value_type

Constructor & Destructor Documentation

template<class Unit, class Y>
boost::units::quantity< Unit, Y >::quantity ( )
inline
template<class Unit, class Y>
boost::units::quantity< Unit, Y >::quantity ( unspecified_null_pointer_constant_type  )
inline
template<class Unit, class Y>
boost::units::quantity< Unit, Y >::quantity ( const this_type source)
inline
template<class Unit, class Y>
template<class YY >
boost::units::quantity< Unit, Y >::quantity ( const quantity< Unit, YY > &  source,
typename boost::enable_if< detail::is_non_narrowing_conversion< YY, Y > >::type = 0 
)
inline

implicit conversion between value types is allowed if allowed for value types themselves

References BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY.

template<class Unit, class Y>
template<class YY >
boost::units::quantity< Unit, Y >::quantity ( const quantity< Unit, YY > &  source,
typename boost::disable_if< detail::is_non_narrowing_conversion< YY, Y > >::type = 0 
)
inlineexplicit

implicit conversion between value types is not allowed if not allowed for value types themselves

References BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY.

template<class Unit, class Y>
template<class Unit2 , class YY >
boost::units::quantity< Unit, Y >::quantity ( const quantity< Unit2, YY > &  source,
typename boost::disable_if< mpl::and_< typename is_implicitly_convertible< Unit2, Unit >::type, detail::is_non_narrowing_conversion< YY, Y > >, typename detail::disable_if_is_same< Unit, Unit2 >::type >::type = 0 
)
inlineexplicit

explicit conversion between different unit systems is allowed if implicit conversion is disallowed

References boost::BOOST_STATIC_ASSERT(), BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY, and boost::program_options::value().

template<class Unit, class Y>
template<class Unit2 , class YY >
boost::units::quantity< Unit, Y >::quantity ( const quantity< Unit2, YY > &  source,
typename boost::enable_if< mpl::and_< typename is_implicitly_convertible< Unit2, Unit >::type, detail::is_non_narrowing_conversion< YY, Y > >, typename detail::disable_if_is_same< Unit, Unit2 >::type >::type = 0 
)
inline

implicit conversion between different unit systems is allowed if each fundamental dimension is implicitly convertible

References boost::BOOST_STATIC_ASSERT(), BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY, and boost::program_options::value().

template<class Unit, class Y>
boost::units::quantity< Unit, Y >::quantity ( const value_type val,
int   
)
inlineexplicitprotected

Member Function Documentation

template<class Unit, class Y>
static this_type boost::units::quantity< Unit, Y >::from_value ( const value_type val)
inlinestatic
template<class Unit, class Y>
template<class Unit2 , class YY >
this_type& boost::units::quantity< Unit, Y >::operator*= ( const quantity< Unit2, YY > &  source)
inline
template<class Unit, class Y>
this_type& boost::units::quantity< Unit, Y >::operator*= ( const value_type source)
inline

can divide a quantity by a scalar value_type if divide_typeof_helper<value_type,value_type>::type is convertible to value_type

template<class Unit, class Y>
template<class Unit2 , class YY >
this_type& boost::units::quantity< Unit, Y >::operator+= ( const quantity< Unit2, YY > &  source)
inline

can subtract a quantity of the same type if subtract_typeof_helper<value_type,value_type>::type is convertible to value_type

template<class Unit, class Y>
template<class Unit2 , class YY >
this_type& boost::units::quantity< Unit, Y >::operator-= ( const quantity< Unit2, YY > &  source)
inline
template<class Unit, class Y>
template<class Unit2 , class YY >
this_type& boost::units::quantity< Unit, Y >::operator/= ( const quantity< Unit2, YY > &  source)
inline

can multiply a quantity by a scalar value_type if multiply_typeof_helper<value_type,value_type>::type is convertible to value_type

References boost::BOOST_STATIC_ASSERT(), and boost::units::quantity< Unit, Y >::value().

template<class Unit, class Y>
this_type& boost::units::quantity< Unit, Y >::operator/= ( const value_type source)
inline

References boost::source().

template<class Unit, class Y>
this_type& boost::units::quantity< Unit, Y >::operator= ( const this_type source)
inline
template<class Unit, class Y>
template<class YY >
this_type& boost::units::quantity< Unit, Y >::operator= ( const quantity< Unit, YY > &  source)
inline

implicit assignment between value types is allowed if allowed for value types themselves

References boost::BOOST_STATIC_ASSERT(), and boost::program_options::value().

template<class Unit, class Y>
template<class Unit2 , class YY >
this_type& boost::units::quantity< Unit, Y >::operator= ( const quantity< Unit2, YY > &  source)
inline

implicit assignment between different unit systems is allowed if each fundamental dimension is implicitly convertible

References boost::BOOST_STATIC_ASSERT(), and boost::program_options::value().


The documentation for this singleton was generated from the following file: