...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::units::base_dimension
// 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. };
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.