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< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y > Class Template Reference

Specialization for dimensionless quantities. More...

#include <quantity.hpp>

Public Types

typedef quantity< unit
< dimensionless_type, System >
, Y > 
this_type
 
typedef Y value_type
 
typedef System system_type
 
typedef dimensionless_type dimension_type
 
typedef unit< dimension_type,
system_type
unit_type
 

Public Member Functions

 quantity ()
 
 quantity (value_type val)
 construction from raw value_type is allowed More...
 
 quantity (const this_type &source)
 
this_typeoperator= (const this_type &source)
 
template<class YY >
 quantity (const quantity< unit< dimension_type, system_type >, 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< dimension_type, system_type >, 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< dimension_type, system_type >, YY > &source)
 implicit assignment between value types is allowed if allowed for value types themselves More...
 
template<class System2 , class Y2 >
 quantity (const quantity< unit< dimensionless_type, System2 >, Y2 > &source, typename boost::enable_if< detail::is_non_narrowing_conversion< Y2, Y > >::type *=0, typename detail::disable_if_is_same< System, System2 >::type *=0, typename boost::enable_if< detail::is_dimensionless_system< System2 > >::type *=0)
 implicit conversion between different unit systems is allowed More...
 
template<class System2 , class Y2 >
 quantity (const quantity< unit< dimensionless_type, System2 >, Y2 > &source, typename boost::disable_if< detail::is_non_narrowing_conversion< Y2, Y > >::type *=0, typename detail::disable_if_is_same< System, System2 >::type *=0, typename boost::enable_if< detail::is_dimensionless_system< System2 > >::type *=0)
 implicit conversion between different unit systems is allowed More...
 
template<class System2 , class Y2 >
 quantity (const quantity< unit< dimensionless_type, System2 >, Y2 > &source, typename boost::disable_if< detail::is_dimensionless_system< System2 > >::type *=0)
 conversion between different unit systems is explicit when the units are not equivalent. More...
 
template<class System2 >
this_typeoperator= (const quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System2), Y > &source)
 implicit assignment between different unit systems is allowed More...
 
 operator value_type () const
 implicit conversion to value_type is allowed More...
 
const value_typevalue () const
 constant accessor to value More...
 
this_typeoperator+= (const this_type &source)
 can subtract a quantity of the same type if subtract_typeof_helper<value_type,value_type>::type is convertible to value_type More...
 
this_typeoperator-= (const this_type &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 &val)
 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 &val)
 

Static Public Member Functions

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

Detailed Description

template<class System, class Y>
class boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >

Specialization for dimensionless quantities.

Implicit conversions between unit systems are allowed because all dimensionless quantities are equivalent. Implicit construction and assignment from and conversion to value_type is also allowed.

Member Typedef Documentation

template<class System , class Y >
typedef dimensionless_type boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::dimension_type
template<class System , class Y >
typedef System boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::system_type
template<class System , class Y >
typedef quantity<unit<dimensionless_type,System>,Y> boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::this_type
template<class System , class Y >
typedef unit<dimension_type,system_type> boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::unit_type
template<class System , class Y >
typedef Y boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::value_type

Constructor & Destructor Documentation

template<class System , class Y >
boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::quantity ( )
inline
template<class System , class Y >
boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::quantity ( value_type  val)
inline

construction from raw value_type is allowed

References BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY.

template<class System , class Y >
boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::quantity ( const this_type source)
inline
template<class System , class Y >
template<class YY >
boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::quantity ( const quantity< unit< dimension_type, system_type >, 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 System , class Y >
template<class YY >
boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::quantity ( const quantity< unit< dimension_type, system_type >, 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 System , class Y >
template<class System2 , class Y2 >
boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::quantity ( const quantity< unit< dimensionless_type, System2 >, Y2 > &  source,
typename boost::enable_if< detail::is_non_narrowing_conversion< Y2, Y > >::type = 0,
typename detail::disable_if_is_same< System, System2 >::type = 0,
typename boost::enable_if< detail::is_dimensionless_system< System2 > >::type = 0 
)
inline

implicit conversion between different unit systems is allowed

References BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY.

template<class System , class Y >
template<class System2 , class Y2 >
boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::quantity ( const quantity< unit< dimensionless_type, System2 >, Y2 > &  source,
typename boost::disable_if< detail::is_non_narrowing_conversion< Y2, Y > >::type = 0,
typename detail::disable_if_is_same< System, System2 >::type = 0,
typename boost::enable_if< detail::is_dimensionless_system< System2 > >::type = 0 
)
inlineexplicit

implicit conversion between different unit systems is allowed

References BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY.

template<class System , class Y >
template<class System2 , class Y2 >
boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::quantity ( const quantity< unit< dimensionless_type, System2 >, Y2 > &  source,
typename boost::disable_if< detail::is_dimensionless_system< System2 > >::type = 0 
)
inlineexplicit

conversion between different unit systems is explicit when the units are not equivalent.

References BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY.

Member Function Documentation

template<class System , class Y >
static this_type boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::from_value ( const value_type val)
inlinestatic

Construct quantity directly from value_type.

template<class System , class Y >
boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::operator value_type ( ) const
inline

implicit conversion to value_type is allowed

template<class System , class Y >
this_type& boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::operator*= ( const value_type val)
inline

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

References boost::phoenix::val().

template<class System , class Y >
this_type& boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::operator+= ( const this_type 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 System , class Y >
this_type& boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::operator-= ( const this_type 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

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

References boost::phoenix::val().

template<class System , class Y >
this_type& boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::operator= ( const this_type source)
inline
template<class System , class Y >
template<class YY >
this_type& boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::operator= ( const quantity< unit< dimension_type, system_type >, 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 System , class Y >
template<class System2 >
this_type& boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::operator= ( const quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System2), Y > &  source)
inline

implicit assignment between different unit systems is allowed

template<class System , class Y >
const value_type& boost::units::quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y >::value ( ) const
inline

constant accessor to value

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


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