Boost C++ Libraries 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.

Class template base_dimension



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

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


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.