]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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_ALIGNMENT_OF_HPP | |
10 | #define BOOST_ALIGN_ALIGNMENT_OF_HPP | |
11 | ||
12 | #include <boost/align/detail/element_type.hpp> | |
13 | #include <boost/align/alignment_of_forward.hpp> | |
14 | ||
15 | #if defined(BOOST_MSVC) | |
16 | #include <boost/align/detail/alignment_of_msvc.hpp> | |
17 | #elif defined(__GNUC__) && defined(__unix__) && !defined(__LP64__) | |
18 | #include <boost/align/detail/alignment_of.hpp> | |
19 | #elif defined(BOOST_CLANG) && !defined(__x86_64__) | |
20 | #include <boost/align/detail/alignment_of.hpp> | |
21 | #elif !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) | |
22 | #include <boost/align/detail/alignment_of_cxx11.hpp> | |
23 | #elif defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600) | |
24 | #include <boost/align/detail/alignment_of_gcc.hpp> | |
25 | #elif defined(__CODEGEARC__) | |
26 | #include <boost/align/detail/alignment_of_codegear.hpp> | |
27 | #elif defined(BOOST_CLANG) | |
28 | #include <boost/align/detail/alignment_of_clang.hpp> | |
29 | #elif __GNUC__ > 4 | |
30 | #include <boost/align/detail/alignment_of_gcc.hpp> | |
31 | #elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) | |
32 | #include <boost/align/detail/alignment_of_gcc.hpp> | |
33 | #else | |
34 | #include <boost/align/detail/alignment_of.hpp> | |
35 | #endif | |
36 | ||
37 | namespace boost { | |
38 | namespace alignment { | |
39 | ||
40 | template<class T> | |
41 | struct alignment_of | |
42 | : detail::alignment_of<typename detail::element_type<T>::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 |