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<                ;     

  // construct/copy/destruct
  ();
  ();
  (const );
  template<typename YY> 
    (const quantity< unit< YY > &, 
              = );
  template<typename YY> 
    (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 > &, 
                       = );
  BOOST_CXX14_CONSTEXPR  (const );
  template<typename YY> 
    BOOST_CXX14_CONSTEXPR  
    (const quantity< unit< YY > &);
  template<typename System2> 
    BOOST_CXX14_CONSTEXPR  
    (const quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System2), Y > &);

  // public member functions
  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 construct/copy/destruct

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

  9. BOOST_CXX14_CONSTEXPR  (const  source);
  10. template<typename YY> 
      BOOST_CXX14_CONSTEXPR  
      (const quantity< unit< YY > & source);
    implicit assignment between value types is allowed if allowed for value types themselves
  11. template<typename System2> 
      BOOST_CXX14_CONSTEXPR  
      (const quantity< BOOST_UNITS_DIMENSIONLESS_UNIT(System2), Y > & source);
    implicit assignment between different unit systems is allowed

quantity public member functions

  1. BOOST_CONSTEXPR () ;
    implicit conversion to value_type is allowed
  2. 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

  3. 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
  4. 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
  5. 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
  6. BOOST_CXX14_CONSTEXPR  (const  val);

quantity public static functions

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

PrevUpHomeNext