zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #01691
[Merge] lp:~paul-lucas/zorba/bug-886543 into lp:zorba
Paul J. Lucas has proposed merging lp:~paul-lucas/zorba/bug-886543 into lp:zorba.
Requested reviews:
Paul J. Lucas (paul-lucas)
Matthias Brantner (matthias-brantner)
Related bugs:
Bug #886543 in Zorba: "Fake std::move() doesn't always work under g++ 4.6.x"
https://bugs.launchpad.net/zorba/+bug/886543
For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/bug-886543/+merge/81359
Added hack fix is to make it move(T const&) and insert a const_cast. This is ugly because it shouldn't move a const T, but since this is a fake move() anyway, it probably doesn't matter.
--
https://code.launchpad.net/~paul-lucas/zorba/bug-886543/+merge/81359
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'include/zorba/internal/type_traits.h'
--- include/zorba/internal/type_traits.h 2011-08-26 03:41:52 +0000
+++ include/zorba/internal/type_traits.h 2011-11-05 13:18:26 +0000
@@ -53,12 +53,13 @@
///////////////////////////////////////////////////////////////////////////////
+#ifndef ZORBA_CXX_UNIQUE_PTR
namespace zorba {
namespace internal {
/**
* \internal
- * Dummy rvalue class used by unique_ptr to prevent copying.
+ * Dummy rvalue class used by unique_ptr to prevent implicit copying.
*/
template<typename T>
class rv : public T {
@@ -89,6 +90,7 @@
} // namespace internal
} // namespace zorba
+#endif /* ZORBA_CXX_UNIQUE_PTR */
///////////////////////////////////////////////////////////////////////////////
=== modified file 'include/zorba/internal/unique_ptr.h'
--- include/zorba/internal/unique_ptr.h 2011-08-27 14:57:52 +0000
+++ include/zorba/internal/unique_ptr.h 2011-11-05 13:18:26 +0000
@@ -40,8 +40,8 @@
template<typename T> inline
typename enable_if<zorba::internal::is_movable<T>::value,
zorba::internal::rv<T>&>::type
-move( T &t ) {
- return *static_cast<zorba::internal::rv<T>*>( &t );
+move( T const &t ) {
+ return *static_cast<zorba::internal::rv<T>*>( const_cast<T*>( &t ) );
}
template<typename T> inline
Follow ups