]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/align/detail/element_type.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / align / detail / element_type.hpp
1 /*
2 Copyright 2015 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_ELEMENT_TYPE_HPP
9 #define BOOST_ALIGN_DETAIL_ELEMENT_TYPE_HPP
10
11 #include <boost/config.hpp>
12
13 #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
14 #include <type_traits>
15 #else
16 #include <cstddef>
17 #endif
18
19 namespace boost {
20 namespace alignment {
21 namespace detail {
22
23 #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
24 using std::remove_reference;
25 using std::remove_all_extents;
26 using std::remove_cv;
27 #else
28 template<class T>
29 struct remove_reference {
30 typedef T type;
31 };
32
33 template<class T>
34 struct remove_reference<T&> {
35 typedef T type;
36 };
37
38 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
39 template<class T>
40 struct remove_reference<T&&> {
41 typedef T type;
42 };
43 #endif
44
45 template<class T>
46 struct remove_all_extents {
47 typedef T type;
48 };
49
50 template<class T>
51 struct remove_all_extents<T[]> {
52 typedef typename remove_all_extents<T>::type type;
53 };
54
55 template<class T, std::size_t N>
56 struct remove_all_extents<T[N]> {
57 typedef typename remove_all_extents<T>::type type;
58 };
59
60 template<class T>
61 struct remove_cv {
62 typedef T type;
63 };
64
65 template<class T>
66 struct remove_cv<const T> {
67 typedef T type;
68 };
69
70 template<class T>
71 struct remove_cv<volatile T> {
72 typedef T type;
73 };
74
75 template<class T>
76 struct remove_cv<const volatile T> {
77 typedef T type;
78 };
79 #endif
80
81 template<class T>
82 struct element_type {
83 typedef typename remove_cv<typename remove_all_extents<typename
84 remove_reference<T>::type>::type>::type type;
85 };
86
87 } /* detail */
88 } /* alignment */
89 } /* boost */
90
91 #endif