Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::units::base_dimension< Derived, N, class > Class Template Reference

Defines a base dimension. More...

#include <base_dimension.hpp>

Inheritance diagram for boost::units::base_dimension< Derived, N, class >:
Collaboration diagram for boost::units::base_dimension< Derived, N, class >:

Public Types

typedef base_dimension this_type
 INTERNAL ONLY. More...
 
typedef list< dim< Derived,
static_rational
< 1 > >, dimensionless_type
dimension_type
 A convenience typedef. Equivalent to boost::units::derived_dimension<Derived,1>::type. More...
 
typedef Derived type
 Provided for mpl compatability. More...
 

Friends

Derived * check_double_register (const units::base_dimension_ordinal< N > &)
 Check for C++0x. More...
 
detail::yes boost_units_is_registered (const units::base_dimension_ordinal< N > &)
 Register this ordinal INTERNAL ONLY. More...
 
detail::yes boost_units_is_registered (const units::base_dimension_pair< Derived, N > &)
 But make sure we can identify the current instantiation! INTERNAL ONLY. More...
 

Detailed Description

template<class Derived, long N, class = typename detail::ordinal_has_already_been_defined< check_base_dimension<Derived, N>::value >::type>
class boost::units::base_dimension< Derived, N, class >

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.

Member Typedef Documentation

template<class Derived, long N, class = typename detail::ordinal_has_already_been_defined< check_base_dimension<Derived, N>::value >::type>
typedef list<dim<Derived,static_rational<1> >, dimensionless_type> boost::units::base_dimension< Derived, N, class >::dimension_type

A convenience typedef. Equivalent to boost::units::derived_dimension<Derived,1>::type.

template<class Derived, long N, class = typename detail::ordinal_has_already_been_defined< check_base_dimension<Derived, N>::value >::type>
typedef base_dimension boost::units::base_dimension< Derived, N, class >::this_type

INTERNAL ONLY.

template<class Derived, long N, class = typename detail::ordinal_has_already_been_defined< check_base_dimension<Derived, N>::value >::type>
typedef Derived boost::units::base_dimension< Derived, N, class >::type

Provided for mpl compatability.

Friends And Related Function Documentation

template<class Derived, long N, class = typename detail::ordinal_has_already_been_defined< check_base_dimension<Derived, N>::value >::type>
detail::yes boost_units_is_registered ( const units::base_dimension_ordinal< N > &  )
friend

Register this ordinal INTERNAL ONLY.

template<class Derived, long N, class = typename detail::ordinal_has_already_been_defined< check_base_dimension<Derived, N>::value >::type>
detail::yes boost_units_is_registered ( const units::base_dimension_pair< Derived, N > &  )
friend

But make sure we can identify the current instantiation! INTERNAL ONLY.

template<class Derived, long N, class = typename detail::ordinal_has_already_been_defined< check_base_dimension<Derived, N>::value >::type>
Derived* check_double_register ( const units::base_dimension_ordinal< N > &  )
friend

Check for C++0x.

In C++0x, we have to have identical arguments but a different return type to trigger an error. Note that this is only needed for clang as check_base_dimension will trigger an error earlier for compilers with less strict name lookup. INTERNAL ONLY


The documentation for this class was generated from the following file: