forked from boostorg/move
Fixes #42 ("<boost/move/unique_ptr.hpp> fails when BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE is set")
This commit is contained in:
@@ -806,6 +806,7 @@ Special thanks to:
|
|||||||
|
|
||||||
* Fixed bugs:
|
* Fixed bugs:
|
||||||
* [@https://github.com/boostorg/move/issues/40 Git Issue #40: ['"Warning 4675 is not defined in MSVC"]].
|
* [@https://github.com/boostorg/move/issues/40 Git Issue #40: ['"Warning 4675 is not defined in MSVC"]].
|
||||||
|
* [@https://github.com/boostorg/move/issues/42 Git Issue #42: ['"<boost/move/unique_ptr.hpp> fails when BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE is set"]].
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
|
@@ -258,12 +258,17 @@
|
|||||||
|
|
||||||
#endif //BOOST_MOVE_DOXYGEN_INVOKED
|
#endif //BOOST_MOVE_DOXYGEN_INVOKED
|
||||||
|
|
||||||
|
} //namespace boost {
|
||||||
|
|
||||||
|
#endif //BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// move_if_not_lvalue_reference
|
// move_if_not_lvalue_reference
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
|
||||||
#if defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
#if defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
||||||
//! <b>Effects</b>: Calls `boost::move` if `input_reference` is not a lvalue reference.
|
//! <b>Effects</b>: Calls `boost::move` if `input_reference` is not a lvalue reference.
|
||||||
@@ -295,8 +300,6 @@
|
|||||||
|
|
||||||
} //namespace boost {
|
} //namespace boost {
|
||||||
|
|
||||||
#endif //#if defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)
|
|
||||||
|
|
||||||
#endif //BOOST_NO_CXX11_RVALUE_REFERENCES
|
#endif //BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||||
|
|
||||||
#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
#if !defined(BOOST_MOVE_DOXYGEN_INVOKED)
|
||||||
|
30
test/unique_ptr_std_move.cpp
Normal file
30
test/unique_ptr_std_move.cpp
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// (C) Copyright Howard Hinnant 2009
|
||||||
|
// (C) Copyright Ion Gaztanaga 2014-2014.
|
||||||
|
//
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
//
|
||||||
|
// See http://www.boost.org/libs/move for documentation.
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
#define BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE
|
||||||
|
#include <boost/move/unique_ptr.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
// main
|
||||||
|
////////////////////////////////
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
//Just test compilation errors
|
||||||
|
boost::movelib::unique_ptr<int> a, b(boost::move(a));
|
||||||
|
BOOST_TEST(!(b.get() || a.get()));
|
||||||
|
b = boost::move(a);
|
||||||
|
b.release();
|
||||||
|
BOOST_TEST(!(b.get() || a.get()));
|
||||||
|
//Test results
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
Reference in New Issue
Block a user