]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/align/detail/integral_constant.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / align / detail / integral_constant.hpp
1 /*
2 Copyright 2014-2016 Glen Joseph Fernandes
3 (glenjofe@gmail.com)
4
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
7 */
8 #ifndef BOOST_ALIGN_DETAIL_INTEGRAL_CONSTANT_HPP
9 #define BOOST_ALIGN_DETAIL_INTEGRAL_CONSTANT_HPP
10
11 #include <boost/config.hpp>
12
13 #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
14 #include <type_traits>
15 #endif
16
17 namespace boost {
18 namespace alignment {
19 namespace detail {
20
21 #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
22 using std::integral_constant;
23 #else
24 template<class T, T Value>
25 struct integral_constant {
26 typedef T value_type;
27 typedef integral_constant type;
28
29 BOOST_CONSTEXPR operator value_type() const BOOST_NOEXCEPT {
30 return Value;
31 }
32
33 BOOST_CONSTEXPR value_type operator()() const BOOST_NOEXCEPT {
34 return Value;
35 }
36
37 BOOST_STATIC_CONSTEXPR T value = Value;
38 };
39
40 template<class T, T Value>
41 BOOST_CONSTEXPR_OR_CONST T integral_constant<T, Value>::value;
42 #endif
43
44 } /* detail */
45 } /* alignment */
46 } /* boost */
47
48 #endif