1 // Boost.Units - A C++ library for zero-overhead dimensional analysis and
2 // unit/quantity manipulation and conversion
4 // Copyright (C) 2003-2008 Matthias Christian Schabel
5 // Copyright (C) 2008 Steven Watanabe
7 // Distributed under the Boost Software License, Version 1.0. (See
8 // accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_UNITS_DERIVED_DIMENSION_HPP
12 #define BOOST_UNITS_DERIVED_DIMENSION_HPP
14 #include <boost/units/dim.hpp>
15 #include <boost/units/dimension.hpp>
16 #include <boost/units/static_rational.hpp>
17 #include <boost/units/units_fwd.hpp>
18 #include <boost/units/detail/dimension_list.hpp>
24 /// A utility class for defining composite dimensions with integer powers.
25 template<class DT1
= dimensionless_type
,long E1
= 0,
26 class DT2
= dimensionless_type
,long E2
= 0,
27 class DT3
= dimensionless_type
,long E3
= 0,
28 class DT4
= dimensionless_type
,long E4
= 0,
29 class DT5
= dimensionless_type
,long E5
= 0,
30 class DT6
= dimensionless_type
,long E6
= 0,
31 class DT7
= dimensionless_type
,long E7
= 0,
32 class DT8
= dimensionless_type
,long E8
= 0>
33 struct derived_dimension
35 #ifdef BOOST_UNITS_DOXYGEN
36 typedef detail::unspecified type
;
39 make_dimension_list
< list
< dim
< DT1
,static_rational
<E1
> >,
40 list
< dim
< DT2
,static_rational
<E2
> >,
41 list
< dim
< DT3
,static_rational
<E3
> >,
42 list
< dim
< DT4
,static_rational
<E4
> >,
43 list
< dim
< DT5
,static_rational
<E5
> >,
44 list
< dim
< DT6
,static_rational
<E6
> >,
45 list
< dim
< DT7
,static_rational
<E7
> >,
46 list
< dim
< DT8
,static_rational
<E8
> >, dimensionless_type
> > > > > > > > >::type type
;
51 template<class DT1
,long E1
>
52 struct derived_dimension
<
63 make_dimension_list
< list
< dim
< DT1
,static_rational
<E1
> >, dimensionless_type
> >::type type
;
67 template<class DT1
,long E1
,
69 struct derived_dimension
<
80 make_dimension_list
< list
< dim
< DT1
,static_rational
<E1
> >,
81 list
< dim
< DT2
,static_rational
<E2
> >, dimensionless_type
> > >::type type
;
85 template<class DT1
,long E1
,
88 struct derived_dimension
<
99 make_dimension_list
< list
< dim
< DT1
,static_rational
<E1
> >,
100 list
< dim
< DT2
,static_rational
<E2
> >,
101 list
< dim
< DT3
,static_rational
<E3
> >, dimensionless_type
> > > >::type type
;
105 template<class DT1
,long E1
,
109 struct derived_dimension
<
114 dimensionless_type
,0,
115 dimensionless_type
,0,
116 dimensionless_type
,0,
117 dimensionless_type
,0>
120 make_dimension_list
< list
< dim
< DT1
,static_rational
<E1
> >,
121 list
< dim
< DT2
,static_rational
<E2
> >,
122 list
< dim
< DT3
,static_rational
<E3
> >,
123 list
< dim
< DT4
,static_rational
<E4
> >, dimensionless_type
> > > > >::type type
;
127 template<class DT1
,long E1
,
132 struct derived_dimension
<
138 dimensionless_type
,0,
139 dimensionless_type
,0,
140 dimensionless_type
,0>
143 make_dimension_list
< list
< dim
< DT1
,static_rational
<E1
> >,
144 list
< dim
< DT2
,static_rational
<E2
> >,
145 list
< dim
< DT3
,static_rational
<E3
> >,
146 list
< dim
< DT4
,static_rational
<E4
> >,
147 list
< dim
< DT5
,static_rational
<E5
> >, dimensionless_type
> > > > > >::type type
;
151 template<class DT1
,long E1
,
157 struct derived_dimension
<
164 dimensionless_type
,0,
165 dimensionless_type
,0>
168 make_dimension_list
< list
< dim
< DT1
,static_rational
<E1
> >,
169 list
< dim
< DT2
,static_rational
<E2
> >,
170 list
< dim
< DT3
,static_rational
<E3
> >,
171 list
< dim
< DT4
,static_rational
<E4
> >,
172 list
< dim
< DT5
,static_rational
<E5
> >,
173 list
< dim
< DT6
,static_rational
<E6
> >, dimensionless_type
> > > > > > >::type type
;
177 template<class DT1
,long E1
,
184 struct derived_dimension
<
192 dimensionless_type
,0>
195 make_dimension_list
< list
< dim
< DT1
,static_rational
<E1
> >,
196 list
< dim
< DT2
,static_rational
<E2
> >,
197 list
< dim
< DT3
,static_rational
<E3
> >,
198 list
< dim
< DT4
,static_rational
<E4
> >,
199 list
< dim
< DT5
,static_rational
<E5
> >,
200 list
< dim
< DT6
,static_rational
<E6
> >,
201 list
< dim
< DT7
,static_rational
<E7
> >, dimensionless_type
> > > > > > > >::type type
;
208 #endif // BOOST_UNITS_DERIVED_DIMENSION_HPP