forked from boostorg/move
* Better header segregation (bug
[@https://svn.boost.org/trac/boost/ticket/6524 #6524]). * Small documentation fixes * Replaced deprecated BOOST_NO_XXXX with newer BOOST_NO_CXX11_XXX macros. [SVN r81515]
This commit is contained in:
@@ -11,9 +11,11 @@
|
||||
#ifndef BOOST_MOVE_TEST_COPYMOVABLE_HPP
|
||||
#define BOOST_MOVE_TEST_COPYMOVABLE_HPP
|
||||
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
|
||||
//[movable_definition
|
||||
//header file "copy_movable.hpp"
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/move/core.hpp>
|
||||
|
||||
//A copy_movable class
|
||||
class copy_movable
|
||||
@@ -43,4 +45,6 @@ class copy_movable
|
||||
|
||||
//]
|
||||
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
#endif //BOOST_MOVE_TEST_COPYMOVABLE_HPP
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
// See http://www.boost.org/libs/move for documentation.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
#include <boost/move/utility.hpp>
|
||||
|
||||
//[clone_ptr_base_derived
|
||||
class Base
|
||||
@@ -152,3 +153,5 @@ int main()
|
||||
//]
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
|
||||
//[construct_forward_example
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/move/utility.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class copyable_only_tester
|
||||
@@ -103,3 +105,5 @@ int main()
|
||||
return 0;
|
||||
}
|
||||
//]
|
||||
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (C) Copyright Ion Gaztanaga 2008-2009.
|
||||
// (C) Copyright Ion Gaztanaga 2008-2012.
|
||||
// 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)
|
||||
@@ -9,9 +9,11 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
|
||||
//[file_descriptor_def
|
||||
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/move/utility.hpp>
|
||||
#include <stdexcept>
|
||||
|
||||
class file_descriptor
|
||||
@@ -85,3 +87,5 @@ int main()
|
||||
return 0;
|
||||
}
|
||||
//]
|
||||
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_RVALUE_REFERENCES)
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -20,8 +20,10 @@ int main()
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
|
||||
//[how_works_example
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/move/core.hpp>
|
||||
#include <iostream>
|
||||
|
||||
class sink_tester
|
||||
@@ -56,5 +58,6 @@ int main()
|
||||
}
|
||||
//]
|
||||
|
||||
#endif
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,8 +9,11 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
|
||||
//[move_algorithms_example
|
||||
#include "movable.hpp"
|
||||
#include <boost/move/algorithm.hpp>
|
||||
#include <cassert>
|
||||
#include <boost/aligned_storage.hpp>
|
||||
|
||||
@@ -39,3 +42,5 @@ int main()
|
||||
return 0;
|
||||
}
|
||||
//]
|
||||
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
@@ -9,10 +9,13 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
|
||||
//[move_inserter_example
|
||||
#include <boost/container/list.hpp>
|
||||
#include "movable.hpp"
|
||||
#include <cassert>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace ::boost::container;
|
||||
|
||||
@@ -27,10 +30,9 @@ void test_move_inserter(list_t &l2, MoveInsertIterator mit)
|
||||
assert(!l.begin()->moved());
|
||||
l2.clear();
|
||||
|
||||
//Move construct
|
||||
for(l_iterator itbeg = l.begin(), itend = l.end(); itbeg != itend; ++itbeg){
|
||||
*mit = *itbeg;
|
||||
}
|
||||
//Move insert into l2 containers
|
||||
std::copy(l.begin(), l.end(), mit);
|
||||
|
||||
//Check size and status
|
||||
assert(l2.size() == l.size());
|
||||
assert(l.begin()->moved());
|
||||
@@ -46,3 +48,5 @@ int main()
|
||||
return 0;
|
||||
}
|
||||
//]
|
||||
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// See http://www.boost.org/libs/move for documentation.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
//[move_iterator_example
|
||||
#include <boost/container/vector.hpp>
|
||||
#include "movable.hpp"
|
||||
@@ -37,3 +37,5 @@ int main()
|
||||
return 0;
|
||||
}
|
||||
//]
|
||||
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
+6
-1
@@ -11,9 +11,12 @@
|
||||
#ifndef BOOST_MOVE_TEST_MOVABLE_HPP
|
||||
#define BOOST_MOVE_TEST_MOVABLE_HPP
|
||||
|
||||
#include <boost/move/detail/config_begin.hpp>
|
||||
|
||||
//[movable_definition
|
||||
//header file "movable.hpp"
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/move/core.hpp>
|
||||
#include <boost/move/traits.hpp>
|
||||
|
||||
//A movable class
|
||||
class movable
|
||||
@@ -46,4 +49,6 @@ struct has_nothrow_move<movable>
|
||||
} //namespace boost{
|
||||
//]
|
||||
|
||||
#include <boost/move/detail/config_end.hpp>
|
||||
|
||||
#endif //BOOST_MOVE_TEST_MOVABLE_HPP
|
||||
|
||||
Reference in New Issue
Block a user