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 the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Class template base_dimension

boost::units::base_dimension

Synopsis

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

template<typename Derived, long N> 
class base_dimension : public ordinal< N > {
public:
  // types
  typedef unspecified dimension_type;  // A convenience typedef. Equivalent to boost::units::derived_dimension<Derived,1>::type. 
  typedef Derived     type;            // Provided for mpl compatability. 
};

Description

Defines a base dimension. To define a dimension you need to provide the derived class (CRTP) and a unique integer.

struct my_dimension : boost::units::base_dimension<my_dimension, 1> {};

It is designed so that you will get an error message if you try to use the same value in multiple definitions.


PrevUpHomeNext