forked from boostorg/type_traits
Fix msvc regression and add additional tests to check issue #1946 fix.
[SVN r50559]
This commit is contained in:
1 parent
0e8f2434ca
commit
101527367a
3 files changed
+238
-1
No files matched your search
@@ -56,7 +56,18 @@ struct alignment_logic
|
||||
template< typename T >
|
||||
struct alignment_of_impl
|
||||
{
|
||||
#ifndef BOOST_ALIGNMENT_OF
|
||||
#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1400)
|
||||
//
|
||||
// With MSVC both the native __alignof operator
|
||||
// and our own logic gets things wrong from time to time :-(
|
||||
// Using a combination of the two seems to make the most of a bad job:
|
||||
//
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value =
|
||||
(::boost::detail::alignment_logic<
|
||||
sizeof(::boost::detail::alignment_of_hack<T>) - sizeof(T),
|
||||
__alignof(T)
|
||||
>::value));
|
||||
#elif !defined(BOOST_ALIGNMENT_OF)
|
||||
BOOST_STATIC_CONSTANT(std::size_t, value =
|
||||
(::boost::detail::alignment_logic<
|
||||
sizeof(::boost::detail::alignment_of_hack<T>) - sizeof(T),
|
||||
|
||||
Reference in new issue
Block a user