summaryrefslogtreecommitdiff
path: root/boost/align/detail/element_type.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:38:45 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-06 10:39:52 +0900
commit5cde13f21d36c7224b0e13d11c4b49379ae5210d (patch)
treee8269ac85a4b0f7d416e2565fa4f451b5cb41351 /boost/align/detail/element_type.hpp
parentd9ec475d945d3035377a0d89ed42e382d8988891 (diff)
downloadboost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.tar.gz
boost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.tar.bz2
boost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.zip
Imported Upstream version 1.61.0
Change-Id: I96a1f878d1e6164f01e9aadd5147f38fca448d90 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/align/detail/element_type.hpp')
-rw-r--r--boost/align/detail/element_type.hpp106
1 files changed, 106 insertions, 0 deletions
diff --git a/boost/align/detail/element_type.hpp b/boost/align/detail/element_type.hpp
new file mode 100644
index 0000000000..793e25ed39
--- /dev/null
+++ b/boost/align/detail/element_type.hpp
@@ -0,0 +1,106 @@
+/*
+(c) 2015 Glen Joseph Fernandes
+<glenjofe -at- gmail.com>
+
+Distributed under the Boost Software
+License, Version 1.0.
+http://boost.org/LICENSE_1_0.txt
+*/
+#ifndef BOOST_ALIGN_DETAIL_ELEMENT_TYPE_HPP
+#define BOOST_ALIGN_DETAIL_ELEMENT_TYPE_HPP
+
+#include <boost/config.hpp>
+
+#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
+#include <type_traits>
+#else
+#include <cstddef>
+#endif
+
+namespace boost {
+namespace alignment {
+namespace detail {
+
+#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
+template<class T>
+struct element_type {
+ typedef typename
+ std::remove_cv<typename
+ std::remove_all_extents<typename
+ std::remove_reference<T>::
+ type>::type>::type type;
+};
+#else
+template<class T>
+struct remove_reference {
+ typedef T type;
+};
+
+template<class T>
+struct remove_reference<T&> {
+ typedef T type;
+};
+
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+template<class T>
+struct remove_reference<T&&> {
+ typedef T type;
+};
+#endif
+
+template<class T>
+struct remove_all_extents {
+ typedef T type;
+};
+
+template<class T>
+struct remove_all_extents<T[]> {
+ typedef typename remove_all_extents<T>::type type;
+};
+
+template<class T, std::size_t N>
+struct remove_all_extents<T[N]> {
+ typedef typename remove_all_extents<T>::type type;
+};
+
+template<class T>
+struct remove_const {
+ typedef T type;
+};
+
+template<class T>
+struct remove_const<const T> {
+ typedef T type;
+};
+
+template<class T>
+struct remove_volatile {
+ typedef T type;
+};
+
+template<class T>
+struct remove_volatile<volatile T> {
+ typedef T type;
+};
+
+template<class T>
+struct remove_cv {
+ typedef typename remove_volatile<typename
+ remove_const<T>::type>::type type;
+};
+
+template<class T>
+struct element_type {
+ typedef typename
+ remove_cv<typename
+ remove_all_extents<typename
+ remove_reference<T>::
+ type>::type>::type type;
+};
+#endif
+
+} /* .detail */
+} /* .alignment */
+} /* .boost */
+
+#endif