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

Click here to view the latest version of this page.
PrevUpHomeNext

Struct template make_dimension_list

boost::units::make_dimension_list

Synopsis

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

template<typename Seq> 
struct make_dimension_list {
  // types
  typedef unspecified type;
};

Description

Reduce dimension list to cardinal form. This algorithm collapses duplicate base dimension tags and sorts the resulting list by the tag ordinal value. Dimension lists that resolve to the same dimension are guaranteed to be represented by an identical type.

The argument should be an MPL forward sequence containing instances of the dim template.

The result is also an MPL forward sequence. It also supports the following metafunctions to allow use as a dimension.

  • mpl::plus is defined only on two equal dimensions and returns the argument unchanged.

  • mpl::minus is defined only for two equal dimensions and returns the argument unchanged.

  • mpl::negate will return its argument unchanged.

  • mpl::times is defined for any dimensions and adds corresponding exponents.

  • mpl::divides is defined for any dimensions and subtracts the exponents of the right had argument from the corresponding exponents of the left had argument. Missing base dimension tags are assumed to have an exponent of zero.

  • static_power takes a dimension and a static_rational and multiplies all the exponents of the dimension by the static_rational.

  • static_root takes a dimension and a static_rational and divides all the exponents of the dimension by the static_rational.


PrevUpHomeNext