Imported Upstream version 1.64.0
[platform/upstream/boost.git] / boost / align / detail / alignment_of_msvc.hpp
1 /*
2 Copyright 2014-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_ALIGNMENT_OF_MSVC_HPP
9 #define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_MSVC_HPP
10
11 #include <boost/align/detail/min_size.hpp>
12
13 namespace boost {
14 namespace alignment {
15 namespace detail {
16
17 template<class T>
18 struct offset_value {
19     T first;
20     char value;
21     T second;
22 };
23
24 template<class T>
25 struct alignment_of
26     : min_size<sizeof(T),
27         sizeof(offset_value<T>) - (sizeof(T) << 1)> { };
28
29 } /* detail */
30 } /* alignment */
31 } /* boost */
32
33 #endif