]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/units/include/boost/units/detail/dimensionless_unit.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / units / include / boost / units / detail / dimensionless_unit.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) 2007-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_DETAIL_DIMENSIONLESS_UNIT_HPP
12#define BOOST_UNITS_DETAIL_DIMENSIONLESS_UNIT_HPP
13
14#include <boost/mpl/bool.hpp>
15#include <boost/units/units_fwd.hpp>
16
17namespace boost {
18namespace units {
19
20template<class T>
21struct heterogeneous_system;
22
23template<class T>
24struct homogeneous_system;
25
26template<class T1, class T2, class Scale>
27struct heterogeneous_system_impl;
28
29typedef boost::units::heterogeneous_system<
30 boost::units::heterogeneous_system_impl<
31 boost::units::dimensionless_type,
32 boost::units::dimensionless_type,
33 boost::units::dimensionless_type
34 >
35> heterogeneous_dimensionless_system;
36
37namespace detail {
38
39template<class System>
40struct void_if_dimensionless {
41 typedef int type;
42};
43
44template<class T>
45struct void_if_dimensionless<boost::units::homogeneous_system<T> > {
46 typedef void type;
47};
48
49template<>
50struct void_if_dimensionless<heterogeneous_dimensionless_system> {
51 typedef void type;
52};
53
54template<class System, class Test = void>
55struct void_if_heterogeneous {
56 typedef void type;
57};
58
59template<class System>
60struct void_if_heterogeneous<System, typename void_if_dimensionless<System>::type> {
61 typedef int type;
62};
63
64template<class System, class Enable=void>
65struct is_dimensionless_system : mpl::false_ {};
66
67template<class System>
68struct is_dimensionless_system<System, typename void_if_dimensionless<System>::type> : mpl::true_ {};
69
70#define BOOST_UNITS_DIMENSIONLESS_UNIT(T)\
71 boost::units::unit<\
72 boost::units::dimensionless_type,\
73 T,\
74 typename ::boost::units::detail::void_if_dimensionless<T>::type\
75 >
76
77#define BOOST_UNITS_HETEROGENEOUS_DIMENSIONLESS_UNIT(T)\
78 boost::units::unit<\
79 boost::units::dimensionless_type,\
80 T,\
81 typename ::boost::units::detail::void_if_heterogeneous<T>::type\
82 >
83
84}
85}
86}
87
88#endif