Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is an old version of boost. Click here for the latest version's documentation home page.
PrevUpHomeNext

Function template operator<<

boost::units::operator<< — Print a quantity.

Synopsis

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


template<typename Char, typename Traits, typename Unit, typename T> 
  std::basic_ostream< Char, Traits > & 
  operator<<(std::basic_ostream< Char, Traits > & os, 
             const quantity< Unit, T > & q);

Description

Prints the value followed by the unit. If the engineering_prefix, or binary_prefix is set, tries to scale the value appropriately. For example, it might print 12.345 km instead of 12345 m. (Note does not attempt to automatically scale scalars like double, float...)


PrevUpHomeNext