Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template quantity

boost::units::quantity — class declaration

Synopsis

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

template<typename Unit, typename Y> 
class quantity {
public:
  // types
  typedef quantity<  ; 
  typedef                    ;
  typedef                 ; 

  // construct/copy/destruct
  ();
  ();
  ();
  template<typename YY> 
    (quantity< ,  = );
  template<typename YY> 
    (quantity< ,  = );
  template<typename Unit2, typename YY> 
    (quantity< ,  = );
  template<typename Unit2, typename YY> 
    (quantity< ,  = );
  (, );
   ();
  template<typename YY> 
     (quantity< );
  template<typename Unit2, typename YY> 
     (quantity< );

  // private member functions
   ();

  // public member functions
   () ;
  template<typename Unit2, typename YY> 
     
    (quantity< );
  template<typename Unit2, typename YY> 
     
    (quantity< );
  template<typename Unit2, typename YY> 
     
    (quantity< );
  template<typename Unit2, typename YY> 
     
    (quantity< );
   ();
   ();

  // public static functions
   ();
};

Description

quantity public construct/copy/destruct

  1. ();
  2. ();
  3. ( source);
  4. template<typename YY> 
      (quantity<  source,  = );
    implicit conversion between value types is allowed if allowed for value types themselves
  5. template<typename YY> 
      (quantity<  source,  = );
    implicit conversion between value types is not allowed if not allowed for value types themselves
  6. template<typename Unit2, typename YY> 
      (quantity<  source,  = );
    explicit conversion between different unit systems is allowed if implicit conversion is disallowed
  7. template<typename Unit2, typename YY> 
      (quantity<  source,  = );
    implicit conversion between different unit systems is allowed if each fundamental dimension is implicitly convertible
  8. ( val, );
  9.  ( source);
  10. template<typename YY> 
       
      (quantity<  source);
    implicit assignment between value types is allowed if allowed for value types themselves
  11. template<typename Unit2, typename YY> 
       
      (quantity<  source);
    implicit assignment between different unit systems is allowed if each fundamental dimension is implicitly convertible

quantity private member functions

  1.  ();

quantity public member functions

  1.  () ;
    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

  2. template<typename Unit2, typename YY> 
       
      (quantity<  source);
    can subtract a quantity of the same type if subtract_typeof_helper<value_type,value_type>::type is convertible to value_type
  3. template<typename Unit2, typename YY> 
       
      (quantity<  source);
  4. template<typename Unit2, typename YY> 
       
      (quantity<  source);
  5. template<typename Unit2, typename YY> 
       
      (quantity<  source);
    can multiply a quantity by a scalar value_type if multiply_typeof_helper<value_type,value_type>::type is convertible to value_type
  6.  ( source);
    can divide a quantity by a scalar value_type if divide_typeof_helper<value_type,value_type>::type is convertible to value_type
  7.  ( source);

quantity public static functions

  1.  ( val);
    Construct quantity directly from value_type (potentially dangerous).

Specializations


PrevUpHomeNext