Merge [51872], [51891] to release. Closes #2878.

[SVN r51907]
This commit is contained in:
Peter Dimov
2009-03-22 20:05:02 +00:00
parent b7cd171b2b
commit e3640e45c2
4 changed files with 189 additions and 0 deletions
+16
View File
@@ -21,6 +21,14 @@ namespace boost
namespace detail
{
template<class T> struct addr_impl_ref
{
T & v_;
inline addr_impl_ref( T & v ): v_( v ) {}
inline operator T& () const { return v_; }
};
template<class T> struct addressof_impl
{
static inline T * f( T & v, long )
@@ -39,7 +47,15 @@ template<class T> struct addressof_impl
template<class T> T * addressof( T & v )
{
#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x610 ) )
return boost::detail::addressof_impl<T>::f( v, 0 );
#else
return boost::detail::addressof_impl<T>::f( boost::detail::addr_impl_ref<T>( v ), 0 );
#endif
}
// Borland doesn't like casting an array reference to a char reference