From b7f99ceba6b7b528b4d3e99e8b7d29a11514b145 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 17 May 2016 18:36:50 +0300 Subject: [PATCH] Update intrusive_ptr_move_test with converting move construction. --- test/intrusive_ptr_move_test.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/intrusive_ptr_move_test.cpp b/test/intrusive_ptr_move_test.cpp index 0e89764..c97bd11 100644 --- a/test/intrusive_ptr_move_test.cpp +++ b/test/intrusive_ptr_move_test.cpp @@ -143,6 +143,18 @@ int main() BOOST_TEST( N::base::instances == 0 ); } + { + boost::intrusive_ptr p( new Y ); + BOOST_TEST( N::base::instances == 1 ); + + boost::intrusive_ptr p2( std::move( p ) ); + BOOST_TEST( N::base::instances == 1 ); + BOOST_TEST( p.get() == 0 ); + + p2.reset(); + BOOST_TEST( N::base::instances == 0 ); + } + { boost::intrusive_ptr p( new X ); BOOST_TEST( N::base::instances == 1 );