|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55114 - branches/release/boost
From: john_at_[hidden]
Date: 2009-07-23 07:20:00
Author: johnmaddock
Date: 2009-07-23 07:20:00 EDT (Thu, 23 Jul 2009)
New Revision: 55114
URL: http://svn.boost.org/trac/boost/changeset/55114
Log:
Bring up to date with Trunk (required by type_traits changes).
Text files modified:
branches/release/boost/aligned_storage.hpp | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
Modified: branches/release/boost/aligned_storage.hpp
==============================================================================
--- branches/release/boost/aligned_storage.hpp (original)
+++ branches/release/boost/aligned_storage.hpp 2009-07-23 07:20:00 EDT (Thu, 23 Jul 2009)
@@ -54,6 +54,14 @@
, type_with_alignment<alignment_>
>::type align_;
} data_;
+ void* address() const { return const_cast<aligned_storage_imp*>(this); }
+};
+
+template< std::size_t alignment_ >
+struct aligned_storage_imp<0u,alignment_>
+{
+ /* intentionally empty */
+ void* address() const { return 0; }
};
}} // namespace detail::aligned_storage
@@ -62,12 +70,15 @@
std::size_t size_
, std::size_t alignment_ = std::size_t(-1)
>
-class aligned_storage
+class aligned_storage :
+#ifndef __BORLANDC__
+ private
+#else
+ public
+#endif
+ detail::aligned_storage::aligned_storage_imp<size_, alignment_>
{
-private: // representation
-
- detail::aligned_storage::aligned_storage_imp<size_, alignment_> data_;
-
+
public: // constants
typedef detail::aligned_storage::aligned_storage_imp<size_, alignment_> type;
@@ -118,14 +129,14 @@
void* address()
{
- return this;
+ return static_cast<type*>(this)->address();
}
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
const void* address() const
{
- return this;
+ return static_cast<const type*>(this)->address();
}
#else // MSVC6
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