Imported Upstream version 1.64.0
[platform/upstream/boost.git] / boost / align / alignment_of.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_ALIGNMENT_OF_HPP
9 #define BOOST_ALIGN_ALIGNMENT_OF_HPP
10
11 #include <boost/align/detail/element_type.hpp>
12 #include <boost/align/alignment_of_forward.hpp>
13
14 #if defined(BOOST_MSVC)
15 #include <boost/align/detail/alignment_of_msvc.hpp>
16 #elif defined(__GNUC__) && defined(__unix__) && !defined(__LP64__)
17 #include <boost/align/detail/alignment_of.hpp>
18 #elif defined(BOOST_CLANG) && !defined(__x86_64__)
19 #include <boost/align/detail/alignment_of.hpp>
20 #elif !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
21 #include <boost/align/detail/alignment_of_cxx11.hpp>
22 #elif defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600)
23 #include <boost/align/detail/alignment_of_gcc.hpp>
24 #elif defined(__CODEGEARC__)
25 #include <boost/align/detail/alignment_of_codegear.hpp>
26 #elif defined(BOOST_CLANG)
27 #include <boost/align/detail/alignment_of_clang.hpp>
28 #elif __GNUC__ > 4
29 #include <boost/align/detail/alignment_of_gcc.hpp>
30 #elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)
31 #include <boost/align/detail/alignment_of_gcc.hpp>
32 #else
33 #include <boost/align/detail/alignment_of.hpp>
34 #endif
35
36 namespace boost {
37 namespace alignment {
38
39 template<class T>
40 struct alignment_of
41     : detail::alignment_of<typename
42         detail::element_type<T>::type>::type { };
43
44 #if !defined(BOOST_NO_CXX14_VARIABLE_TEMPLATES)
45 template<class T>
46 constexpr std::size_t alignment_of_v = alignment_of<T>::value;
47 #endif
48
49 } /* alignment */
50 } /* boost */
51
52 #endif