Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/units/homogeneous_system.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 // Boost.Units - A C++ library for zero-overhead dimensional analysis and | |
2 // unit/quantity manipulation and conversion | |
3 // | |
4 // Copyright (C) 2003-2008 Matthias Christian Schabel | |
5 // Copyright (C) 2008 Steven Watanabe | |
6 // | |
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) | |
10 | |
11 #ifndef BOOST_UNITS_HOMOGENEOUS_SYSTEM_HPP_INCLUDED | |
12 #define BOOST_UNITS_HOMOGENEOUS_SYSTEM_HPP_INCLUDED | |
13 | |
14 #include <boost/mpl/bool.hpp> | |
15 | |
16 #include <boost/units/config.hpp> | |
17 #include <boost/units/static_rational.hpp> | |
18 | |
19 #ifdef BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS | |
20 | |
21 #include <boost/type_traits/is_same.hpp> | |
22 #include <boost/mpl/not.hpp> | |
23 | |
24 #include <boost/units/detail/linear_algebra.hpp> | |
25 | |
26 #endif | |
27 | |
28 namespace boost { | |
29 | |
30 namespace units { | |
31 | |
32 /// A system that can uniquely represent any unit | |
33 /// which can be composed from a linearly independent set | |
34 /// of base units. It is safe to rebind a unit with | |
35 /// such a system to different dimensions. | |
36 /// | |
37 /// Do not construct this template directly. Use | |
38 /// make_system instead. | |
39 template<class L> | |
40 struct homogeneous_system { | |
41 /// INTERNAL ONLY | |
42 typedef L type; | |
43 }; | |
44 | |
45 template<class T, class E> | |
46 struct static_power; | |
47 | |
48 template<class T, class R> | |
49 struct static_root; | |
50 | |
51 /// INTERNAL ONLY | |
52 template<class L, long N, long D> | |
53 struct static_power<homogeneous_system<L>, static_rational<N,D> > | |
54 { | |
55 typedef homogeneous_system<L> type; | |
56 }; | |
57 | |
58 /// INTERNAL ONLY | |
59 template<class L, long N, long D> | |
60 struct static_root<homogeneous_system<L>, static_rational<N,D> > | |
61 { | |
62 typedef homogeneous_system<L> type; | |
63 }; | |
64 | |
65 namespace detail { | |
66 | |
67 template<class System, class Dimensions> | |
68 struct check_system; | |
69 | |
70 #ifdef BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS | |
71 | |
72 template<class L, class Dimensions> | |
73 struct check_system<homogeneous_system<L>, Dimensions> : | |
74 boost::mpl::not_< | |
75 boost::is_same< | |
76 typename calculate_base_unit_exponents< | |
77 L, | |
78 Dimensions | |
79 >::type, | |
80 inconsistent | |
81 > | |
82 > {}; | |
83 | |
84 #else | |
85 | |
86 template<class L, class Dimensions> | |
87 struct check_system<homogeneous_system<L>, Dimensions> : mpl::true_ {}; | |
88 | |
89 #endif | |
90 | |
91 } // namespace detail | |
92 | |
93 } // namespace units | |
94 | |
95 } // namespace boost | |
96 | |
97 #if BOOST_UNITS_HAS_BOOST_TYPEOF | |
98 | |
99 #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() | |
100 | |
101 BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::homogeneous_system, (class)) | |
102 | |
103 #endif | |
104 | |
105 #endif |