summaryrefslogtreecommitdiff
path: root/boost/align/detail/alignment_of_msvc.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/align/detail/alignment_of_msvc.hpp')
-rw-r--r--boost/align/detail/alignment_of_msvc.hpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/boost/align/detail/alignment_of_msvc.hpp b/boost/align/detail/alignment_of_msvc.hpp
index 87d6ac8e28..df6912f411 100644
--- a/boost/align/detail/alignment_of_msvc.hpp
+++ b/boost/align/detail/alignment_of_msvc.hpp
@@ -1,6 +1,6 @@
/*
-(c) 2014 Glen Joseph Fernandes
-glenjofe at gmail dot com
+(c) 2014-2015 Glen Joseph Fernandes
+<glenjofe -at- gmail.com>
Distributed under the Boost Software
License, Version 1.0.
@@ -10,19 +10,26 @@ http://boost.org/LICENSE_1_0.txt
#define BOOST_ALIGN_DETAIL_ALIGNMENT_OF_MSVC_HPP
#include <boost/align/detail/min_size.hpp>
-#include <boost/align/detail/offset_object.hpp>
namespace boost {
namespace alignment {
namespace detail {
template<class T>
+struct alignof_helper {
+ T first;
+ char value;
+ T second;
+};
+
+template<class T>
struct alignment_of
- : min_size<sizeof(T), offsetof(offset_object<T>, object)>::type {
+ : min_size<sizeof(T),
+ sizeof(alignof_helper<T>) - (sizeof(T) << 1)>::type {
};
-} /* :detail */
-} /* :alignment */
-} /* :boost */
+} /* .detail */
+} /* .alignment */
+} /* .boost */
#endif