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