]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/units/include/boost/units/detail/dim_impl.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / units / include / boost / units / detail / dim_impl.hpp
CommitLineData
7c673cae
FG
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_DIM_IMPL_HPP
12#define BOOST_UNITS_DIM_IMPL_HPP
13
14#include <boost/mpl/bool.hpp>
15#include <boost/mpl/less.hpp>
16
17#include <boost/units/units_fwd.hpp>
18
19/// \file
20/// \brief Class encapsulating a dimension tag/value pair
21
22namespace boost {
23
24namespace units {
25
26namespace detail {
27
28struct dim_tag;
29
30}
31
32}
33
34namespace mpl {
35
36/// Less than comparison for sorting @c dim.
37template<>
38struct less_impl<boost::units::detail::dim_tag, boost::units::detail::dim_tag>
39{
40 template<class T0, class T1>
41 struct apply : mpl::less<typename T0::tag_type, typename T1::tag_type> {};
42};
43
44}
45
46namespace units {
47
48template<class Tag, class Exponent>
49struct dim;
50
51template<long N, long D>
52class static_rational;
53
54namespace detail {
55
56/// Extract @c tag_type from a @c dim.
57template<typename T>
58struct get_tag
59{
60 typedef typename T::tag_type type;
61};
62
63/// Extract @c value_type from a @c dim.
64template<typename T>
65struct get_value
66{
67 typedef typename T::value_type type;
68};
69
70/// Determine if a @c dim is empty (has a zero exponent).
71template<class T>
72struct is_empty_dim;
73
74template<typename T>
75struct is_empty_dim< dim<T, static_rational<0, 1> > > :
76 mpl::true_
77{ };
78
79template<typename T, typename V>
80struct is_empty_dim< dim<T, V> > :
81 mpl::false_
82{ };
83
84} // namespace detail
85
86} // namespace units
87
88} // namespace boost
89
90#endif // BOOST_UNITS_DIM_IMPL_HPP