forked from boostorg/move
Updated documentation and tests to Boost.Container
[SVN r74156]
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/interprocess/containers/vector.hpp>
|
||||
#include <boost/interprocess/containers/list.hpp>
|
||||
#include <boost/interprocess/containers/stable_vector.hpp>
|
||||
#include <boost/container/deque.hpp>
|
||||
#include <boost/container/list.hpp>
|
||||
#include <boost/container/stable_vector.hpp>
|
||||
#include "../example/movable.hpp"
|
||||
|
||||
template<class Container>
|
||||
@@ -46,15 +46,15 @@ int move_test()
|
||||
|
||||
int main()
|
||||
{
|
||||
namespace bi = ::boost::interprocess;
|
||||
namespace bc = ::boost::container;
|
||||
|
||||
if(move_test< bi::vector<movable> >()){
|
||||
if(move_test< bc::vector<movable> >()){
|
||||
return 1;
|
||||
}
|
||||
if(move_test< bi::list<movable> >()){
|
||||
if(move_test< bc::list<movable> >()){
|
||||
return 1;
|
||||
}
|
||||
if(move_test< bi::stable_vector<movable> >()){
|
||||
if(move_test< bc::stable_vector<movable> >()){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/interprocess/containers/vector.hpp>
|
||||
#include <boost/container/vector.hpp>
|
||||
#include "../example/movable.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
namespace bi = ::boost::interprocess;
|
||||
namespace bc = ::boost::container;
|
||||
//Default construct 10 movable objects
|
||||
bi::vector<movable> v(10);
|
||||
bi::vector<movable> v2(10);
|
||||
bc::vector<movable> v(10);
|
||||
bc::vector<movable> v2(10);
|
||||
|
||||
//Move to v2
|
||||
boost::move(v.begin(), v.end(), v2.begin());
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/interprocess/containers/vector.hpp>
|
||||
#include <boost/container/vector.hpp>
|
||||
#include "../example/movable.hpp"
|
||||
|
||||
int main()
|
||||
{
|
||||
namespace bi = ::boost::interprocess;
|
||||
namespace bc = ::boost::container;
|
||||
//Default construct 10 movable objects
|
||||
bi::vector<movable> v(10);
|
||||
bc::vector<movable> v(10);
|
||||
|
||||
//Test default constructed value
|
||||
if(v[0].moved()){
|
||||
@@ -25,7 +25,7 @@ int main()
|
||||
}
|
||||
|
||||
//Move values
|
||||
bi::vector<movable> v2
|
||||
bc::vector<movable> v2
|
||||
(boost::make_move_iterator(v.begin()), boost::make_move_iterator(v.end()));
|
||||
|
||||
//Test values have been moved
|
||||
|
||||
Reference in New Issue
Block a user