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,  ;     
  typedef                                                  ;    
  typedef                                             ;   
  typedef dimensionless_type                                ;
  typedef unit<                ;     

  // construct/copy/destruct
  ();
  ();
  ();
  template<typename YY> 
    (quantity< unit< , 
              = );
  template<typename YY> 
    (quantity< unit< , 
                       = );
  template<typename System2, typename Y2> 
    (quantity< unit< dimensionless_type, , 
              = ,  = ,  = );
  template<typename System2, typename Y2> 
    (quantity< unit< dimensionless_type, , 
                       = ,  = ,  = );
  template<typename System2, typename Y2> 
    (quantity< unit< dimensionless_type, , 
                       = );
   ();
  template<typename YY> 
     
    (quantity< unit< );
  template<typename System2> 
     
    (quantity< );

  // public member functions
   () ;
   () ;
   ();
   ();
   ();
   ();

  // public static functions
   ();
};

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

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

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

quantity public member functions

  1.  () ;
    implicit conversion to value_type is allowed
  2.  () ;
    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.  ( source);
    can subtract a quantity of the same type if subtract_typeof_helper<value_type,value_type>::type is convertible to value_type
  4.  ( 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.  ( 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.  ( val);

quantity public static functions

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

PrevUpHomeNext