]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/align/include/boost/align/detail/element_type.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / align / include / boost / align / detail / element_type.hpp
CommitLineData
7c673cae
FG
1/*
2(c) 2015 Glen Joseph Fernandes
3<glenjofe -at- gmail.com>
4
5Distributed under the Boost Software
6License, Version 1.0.
7http://boost.org/LICENSE_1_0.txt
8*/
9#ifndef BOOST_ALIGN_DETAIL_ELEMENT_TYPE_HPP
10#define BOOST_ALIGN_DETAIL_ELEMENT_TYPE_HPP
11
12#include <boost/config.hpp>
13
14#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
15#include <type_traits>
16#else
17#include <cstddef>
18#endif
19
20namespace boost {
21namespace alignment {
22namespace detail {
23
24#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
25using std::remove_reference;
26using std::remove_all_extents;
27using std::remove_cv;
28#else
29template<class T>
30struct remove_reference {
31 typedef T type;
32};
33
34template<class T>
35struct remove_reference<T&> {
36 typedef T type;
37};
38
39#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
40template<class T>
41struct remove_reference<T&&> {
42 typedef T type;
43};
44#endif
45
46template<class T>
47struct remove_all_extents {
48 typedef T type;
49};
50
51template<class T>
52struct remove_all_extents<T[]>
53 : remove_all_extents<T> { };
54
55template<class T, std::size_t N>
56struct remove_all_extents<T[N]>
57 : remove_all_extents<T> { };
58
59template<class T>
60struct remove_const {
61 typedef T type;
62};
63
64template<class T>
65struct remove_const<const T> {
66 typedef T type;
67};
68
69template<class T>
70struct remove_volatile {
71 typedef T type;
72};
73
74template<class T>
75struct remove_volatile<volatile T> {
76 typedef T type;
77};
78
79template<class T>
80struct remove_cv
81 : remove_volatile<typename remove_const<T>::type> { };
82#endif
83
84template<class T>
85struct element_type
86 : remove_cv<typename remove_all_extents<typename
87 remove_reference<T>::type>::type> { };
88
89} /* .detail */
90} /* .alignment */
91} /* .boost */
92
93#endif