|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50560 - in branches/release: boost/type_traits libs/type_traits/test
From: john_at_[hidden]
Date: 2009-01-13 08:02:57
Author: johnmaddock
Date: 2009-01-13 08:02:56 EST (Tue, 13 Jan 2009)
New Revision: 50560
URL: http://svn.boost.org/trac/boost/changeset/50560
Log:
Merge msvc-specific regression-fixes from trunk.
Added:
branches/release/libs/type_traits/test/aligned_storage_test_a2.cpp
- copied unchanged from r50559, /trunk/libs/type_traits/test/aligned_storage_test_a2.cpp
branches/release/libs/type_traits/test/alignment_of_test_a2.cpp
- copied unchanged from r50559, /trunk/libs/type_traits/test/alignment_of_test_a2.cpp
Text files modified:
branches/release/boost/type_traits/alignment_of.hpp | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
Modified: branches/release/boost/type_traits/alignment_of.hpp
==============================================================================
--- branches/release/boost/type_traits/alignment_of.hpp (original)
+++ branches/release/boost/type_traits/alignment_of.hpp 2009-01-13 08:02:56 EST (Tue, 13 Jan 2009)
@@ -56,7 +56,18 @@
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),
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk