X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=boost%2Fboost%2Futility%2Faddressof.hpp;h=95cd92fca9bb940ae0f9a289268a0fe4a9305b68;hb=43c09d723435a5b203f2ac0c39e2086de836b386;hp=8e0a586880ec53de60565f422ef6d4677aa4db2d;hpb=c2f99181e60c3b92ddeed85a5910ac856d155810;p=lyx.git diff --git a/boost/boost/utility/addressof.hpp b/boost/boost/utility/addressof.hpp index 8e0a586880..95cd92fca9 100644 --- a/boost/boost/utility/addressof.hpp +++ b/boost/boost/utility/addressof.hpp @@ -21,6 +21,17 @@ namespace boost namespace detail { +template struct addr_impl_ref +{ + T & v_; + + inline addr_impl_ref( T & v ): v_( v ) {} + inline operator T& () const { return v_; } + +private: + addr_impl_ref & operator=(const addr_impl_ref &); +}; + template struct addressof_impl { static inline T * f( T & v, long ) @@ -39,12 +50,40 @@ template struct addressof_impl template T * addressof( T & v ) { +#if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x610 ) ) + return boost::detail::addressof_impl::f( v, 0 ); + +#else + + return boost::detail::addressof_impl::f( boost::detail::addr_impl_ref( v ), 0 ); + +#endif +} + +#if defined( __SUNPRO_CC ) && BOOST_WORKAROUND( __SUNPRO_CC, BOOST_TESTED_AT( 0x590 ) ) + +namespace detail +{ + +template struct addressof_addp +{ + typedef T * type; +}; + +} // namespace detail + +template< class T, std::size_t N > +typename detail::addressof_addp< T[N] >::type addressof( T (&t)[N] ) +{ + return &t; } +#endif + // Borland doesn't like casting an array reference to a char reference // but these overloads work around the problem. -# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if defined( __BORLANDC__ ) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) template T (*addressof(T (&t)[N]))[N] { @@ -56,7 +95,7 @@ const T (*addressof(const T (&t)[N]))[N] { return reinterpret_cast(&t); } -# endif +#endif } // namespace boost