Index: aligned_storage.hpp =================================================================== --- aligned_storage.hpp (revision 52771) +++ aligned_storage.hpp (working copy) @@ -54,20 +54,25 @@ , type_with_alignment >::type align_; } data_; + void* address() const { return const_cast(this); } }; +template< std::size_t alignment_ > +struct aligned_storage_imp<0u,alignment_> +{ + /* intentionally empty */ + void* address() const { return 0; } +}; + }} // namespace detail::aligned_storage template < std::size_t size_ , std::size_t alignment_ = std::size_t(-1) > -class aligned_storage +class aligned_storage : private detail::aligned_storage::aligned_storage_imp { -private: // representation - - detail::aligned_storage::aligned_storage_imp data_; - + public: // constants typedef detail::aligned_storage::aligned_storage_imp type; @@ -118,14 +123,14 @@ void* address() { - return this; + return static_cast(this)->address(); } #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) const void* address() const { - return this; + return static_cast(this)->address(); } #else // MSVC6