Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template quantity<, >

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

Synopsis

// In header: <boost/units/quantity.hpp>

template<typename System, typename Y> 
class quantity<, > {
public:
  // types
  typedef quantity< unit< dimensionless_type, System >, Y > ;     
  typedef Y                                                 ;    
  typedef System                                            ;   
  typedef dimensionless_type                                ;
  typedef unit<                ;     

  // public member functions
  ();
  ();
  (const  );
  BOOST_CXX14_CONSTEXPR   (const  );
  template<typename YY> 
    (const  quantity< unit< YY > &, 
              = );
  template<typename YY> 
    (const  quantity< unit< YY > &, 
                       = );
  template<typename YY> 
    BOOST_CXX14_CONSTEXPR   
    (const  quantity< unit< YY > &);
  template<typename System2, typename Y2> 
    (const  quantity< unit< dimensionless_type, System2 >, Y2 > &, 
              = ,  = ,  = );
  template<typename System2, typename Y2> 
    (const  quantity< unit< dimensionless_type, System2 >, Y2 > &, 
                       = ,  = ,  = );
  template<typename System2, typename Y2> 
    (const  quantity< unit< dimensionless_type, System2 >, Y2 > &, 
                       = );
  template<typename System2> 
    BOOST_CXX14_CONSTEXPR   
    (const  quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System2), Y > &);
  BOOST_CONSTEXPR () ;
  BOOST_CONSTEXPR  const   () ;
  BOOST_CXX14_CONSTEXPR   (const  );
  BOOST_CXX14_CONSTEXPR   (const  );
  BOOST_CXX14_CONSTEXPR   (const  );
  BOOST_CXX14_CONSTEXPR   (const  );

  // public static functions
  BOOST_CONSTEXPR   (const  );
};

Description

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.

quantity public member functions

  1. ();
  2. ( val);
    construction from raw value_type is allowed
  3. (const   source);
  4. BOOST_CXX14_CONSTEXPR   (const   source);
  5. template<typename YY> 
      (const  quantity< unit< YY > & source, 
                = );
    implicit conversion between value types is allowed if allowed for value types themselves
  6. template<typename YY> 
      (const  quantity< unit< YY > & source, 
                         = );
    implicit conversion between value types is not allowed if not allowed for value types themselves
  7. template<typename YY> 
      BOOST_CXX14_CONSTEXPR   
      (const  quantity< unit< YY > & source);
    implicit assignment between value types is allowed if allowed for value types themselves
  8. template<typename System2, typename Y2> 
      (const  quantity< unit< dimensionless_type, System2 >, Y2 > & source, 
                = ,  = ,  = );
    implicit conversion between different unit systems is allowed
  9. template<typename System2, typename Y2> 
      (const  quantity< unit< dimensionless_type, System2 >, Y2 > & source, 
                         = ,  = ,  = );
    implicit conversion between different unit systems is allowed
  10. template<typename System2, typename Y2> 
      (const  quantity< unit< dimensionless_type, System2 >, Y2 > & source, 
                         = );

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

  11. template<typename System2> 
      BOOST_CXX14_CONSTEXPR   
      (const  quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System2), Y > & source);
    implicit assignment between different unit systems is allowed
  12. BOOST_CONSTEXPR () ;
    implicit conversion to value_type is allowed
  13. BOOST_CONSTEXPR  const   () ;
    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

  14. BOOST_CXX14_CONSTEXPR   (const   source);
    can subtract a quantity of the same type if subtract_typeof_helper<value_type,value_type>::type is convertible to value_type
  15. BOOST_CXX14_CONSTEXPR   (const   source);
    can multiply a quantity by a scalar value_type if multiply_typeof_helper<value_type,value_type>::type is convertible to value_type
  16. BOOST_CXX14_CONSTEXPR   (const   val);
    can divide a quantity by a scalar value_type if divide_typeof_helper<value_type,value_type>::type is convertible to value_type
  17. BOOST_CXX14_CONSTEXPR   (const   val);

quantity public static functions

  1. BOOST_CONSTEXPR   (const   val);
    Construct quantity directly from value_type.

PrevUpHomeNext