mirror of
https://github.com/boostorg/utility.git
synced 2025-05-11 05:14:02 +00:00
Merge [51977], [51986], [52010] to release.
[SVN r52040]
This commit is contained in:
parent
e3640e45c2
commit
a69e872a91
@ -47,7 +47,7 @@ template<class T> struct addressof_impl
|
|||||||
|
|
||||||
template<class T> T * addressof( T & v )
|
template<class T> T * addressof( T & v )
|
||||||
{
|
{
|
||||||
#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x610 ) )
|
#if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x610 ) )
|
||||||
|
|
||||||
return boost::detail::addressof_impl<T>::f( v, 0 );
|
return boost::detail::addressof_impl<T>::f( v, 0 );
|
||||||
|
|
||||||
@ -58,9 +58,29 @@ template<class T> T * addressof( T & v )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined( __SUNPRO_CC ) && BOOST_WORKAROUND( __SUNPRO_CC, BOOST_TESTED_AT( 0x590 ) )
|
||||||
|
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
|
||||||
|
template<class T> 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
|
// Borland doesn't like casting an array reference to a char reference
|
||||||
// but these overloads work around the problem.
|
// 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<typename T,std::size_t N>
|
template<typename T,std::size_t N>
|
||||||
T (*addressof(T (&t)[N]))[N]
|
T (*addressof(T (&t)[N]))[N]
|
||||||
{
|
{
|
||||||
@ -72,7 +92,7 @@ const T (*addressof(const T (&t)[N]))[N]
|
|||||||
{
|
{
|
||||||
return reinterpret_cast<const T(*)[N]>(&t);
|
return reinterpret_cast<const T(*)[N]>(&t);
|
||||||
}
|
}
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user