X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=boost%2Fboost%2Faligned_storage.hpp;h=ce277ab702ad4db26644b86bebce1b74eab59dec;hb=43c09d723435a5b203f2ac0c39e2086de836b386;hp=9ab94a083552318b159393fadfbc81d2498c6fb4;hpb=376aaac146989c2060f4159a16c7e8238b400088;p=lyx.git diff --git a/boost/boost/aligned_storage.hpp b/boost/boost/aligned_storage.hpp index 9ab94a0835..ce277ab702 100644 --- a/boost/boost/aligned_storage.hpp +++ b/boost/boost/aligned_storage.hpp @@ -54,6 +54,14 @@ struct aligned_storage_imp , 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 @@ -62,12 +70,15 @@ template < 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 { -private: // representation - - detail::aligned_storage::aligned_storage_imp data_; - + public: // constants typedef detail::aligned_storage::aligned_storage_imp type; @@ -118,14 +129,14 @@ public: // accessors void* address() { - return this; + return static_cast(this)->address(); } -#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200) +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) const void* address() const { - return this; + return static_cast(this)->address(); } #else // MSVC6 @@ -136,7 +147,7 @@ public: // accessors }; -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1200) +#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // MSVC6 seems not to like inline functions with const void* returns, so we // declare the following here: