Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51907 - in branches/release: boost/utility libs/utility libs/utility/test
From: pdimov_at_[hidden]
Date: 2009-03-22 16:05:03


Author: pdimov
Date: 2009-03-22 16:05:02 EDT (Sun, 22 Mar 2009)
New Revision: 51907
URL: http://svn.boost.org/trac/boost/changeset/51907

Log:
Merge [51872], [51891] to release. Closes #2878.
Added:
   branches/release/libs/utility/addressof_fn_test.cpp
      - copied unchanged from r51872, /trunk/libs/utility/addressof_fn_test.cpp
   branches/release/libs/utility/addressof_test2.cpp
      - copied unchanged from r51872, /trunk/libs/utility/addressof_test2.cpp
Text files modified:
   branches/release/boost/utility/addressof.hpp | 16 ++++++++++++++++
   branches/release/libs/utility/test/Jamfile.v2 | 2 ++
   2 files changed, 18 insertions(+), 0 deletions(-)

Modified: branches/release/boost/utility/addressof.hpp
==============================================================================
--- branches/release/boost/utility/addressof.hpp (original)
+++ branches/release/boost/utility/addressof.hpp 2009-03-22 16:05:02 EDT (Sun, 22 Mar 2009)
@@ -21,6 +21,14 @@
 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> 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

Modified: branches/release/libs/utility/test/Jamfile.v2
==============================================================================
--- branches/release/libs/utility/test/Jamfile.v2 (original)
+++ branches/release/libs/utility/test/Jamfile.v2 2009-03-22 16:05:02 EDT (Sun, 22 Mar 2009)
@@ -11,7 +11,9 @@
 # Please keep the tests ordered by filename
 test-suite utility
     :
+ [ run ../addressof_fn_test.cpp ]
         [ run ../addressof_test.cpp ]
+ [ run ../addressof_test2.cpp ]
         [ run ../assert_test.cpp ]
         [ run ../base_from_member_test.cpp ]
         [ run ../binary_search_test.cpp ]


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk