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_unit< Derived, Dim, N, class > Class Template Reference

Defines a base unit. More...

#include <base_unit.hpp>

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

Public Types

typedef void boost_units_is_base_unit_type
 INTERNAL ONLY. More...
 
typedef base_unit this_type
 INTERNAL ONLY. More...
 
typedef Dim dimension_type
 The dimensions of this base unit. More...
 
typedef Derived type
 Provided for mpl compatability. More...
 
typedef unit< Dim,
heterogeneous_system
< heterogeneous_system_impl
< list
< heterogeneous_system_dim
< Derived, static_rational
< 1 > >, dimensionless_type >
, Dim, no_scale > > > 
unit_type
 The unit corresponding to this base unit. More...
 

Friends

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

Detailed Description

template<class Derived, class Dim, long N, class = typename detail::ordinal_has_already_been_defined< check_base_unit<Derived, N>::value >::type>
class boost::units::base_unit< Derived, Dim, N, class >

Defines a base unit.

To define a unit you need to provide the derived class (CRTP), a dimension list and a unique integer.

struct my_unit : boost::units::base_unit<my_unit, length_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, class Dim, long N, class = typename detail::ordinal_has_already_been_defined< check_base_unit<Derived, N>::value >::type>
typedef void boost::units::base_unit< Derived, Dim, N, class >::boost_units_is_base_unit_type

INTERNAL ONLY.

template<class Derived, class Dim, long N, class = typename detail::ordinal_has_already_been_defined< check_base_unit<Derived, N>::value >::type>
typedef Dim boost::units::base_unit< Derived, Dim, N, class >::dimension_type

The dimensions of this base unit.

template<class Derived, class Dim, long N, class = typename detail::ordinal_has_already_been_defined< check_base_unit<Derived, N>::value >::type>
typedef base_unit boost::units::base_unit< Derived, Dim, N, class >::this_type

INTERNAL ONLY.

template<class Derived, class Dim, long N, class = typename detail::ordinal_has_already_been_defined< check_base_unit<Derived, N>::value >::type>
typedef Derived boost::units::base_unit< Derived, Dim, N, class >::type

Provided for mpl compatability.

template<class Derived, class Dim, long N, class = typename detail::ordinal_has_already_been_defined< check_base_unit<Derived, N>::value >::type>
typedef unit< Dim, heterogeneous_system< heterogeneous_system_impl< list< heterogeneous_system_dim<Derived,static_rational<1> >, dimensionless_type >, Dim, no_scale > > > boost::units::base_unit< Derived, Dim, N, class >::unit_type

The unit corresponding to this base unit.

Friends And Related Function Documentation

template<class Derived, class Dim, long N, class = typename detail::ordinal_has_already_been_defined< check_base_unit<Derived, N>::value >::type>
detail::yes boost_units_unit_is_registered ( const units::base_unit_ordinal< N > &  )
friend

Register this ordinal INTERNAL ONLY.

template<class Derived, class Dim, long N, class = typename detail::ordinal_has_already_been_defined< check_base_unit<Derived, N>::value >::type>
detail::yes boost_units_unit_is_registered ( const units::base_unit_pair< Derived, N > &  )
friend

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

template<class Derived, class Dim, long N, class = typename detail::ordinal_has_already_been_defined< check_base_unit<Derived, N>::value >::type>
Derived* check_double_register ( const units::base_unit_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_unit 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: