![]() |
Home | Libraries | People | FAQ | More |
boost::units::base_dimension
template<typename Derived, long N> class base_dimension { 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.
定義一個基礎量綱。你需要提供派生類(CRTP)和唯一的整數。
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.
如果你試圖對多個定義使用相同的整數,你會得到一個編譯錯誤。