mirror of
https://github.com/boostorg/move.git
synced 2025-07-31 12:57:14 +02:00
Merged from trunk
[SVN r79561]
This commit is contained in:
@ -787,6 +787,14 @@ Many thanks to all boosters that have tested, reviewed and improved the library.
|
||||
|
||||
[section:release_notes Release Notes]
|
||||
|
||||
[section:release_notes_boost_1_51_00 Boost 1.51 Release]
|
||||
|
||||
* Fixed bugs
|
||||
[@https://svn.boost.org/trac/boost/ticket/7095 #7095],
|
||||
[@https://svn.boost.org/trac/boost/ticket/7031 #7031].
|
||||
|
||||
[endsect]
|
||||
|
||||
[section:release_notes_boost_1_49_00 Boost 1.49 Release]
|
||||
|
||||
* Fixed bugs
|
||||
|
@ -17,29 +17,42 @@
|
||||
template<class Container>
|
||||
int move_test()
|
||||
{
|
||||
//Default construct 10 movable objects
|
||||
Container v(10);
|
||||
bool use_move_iterator = false;
|
||||
bool done = false;
|
||||
while(!done){
|
||||
//Default construct 10 movable objects
|
||||
Container v(10);
|
||||
|
||||
//Test default constructed value
|
||||
if(v.begin()->moved()){
|
||||
return 1;
|
||||
}
|
||||
//Test default constructed value
|
||||
if(v.begin()->moved()){
|
||||
return 1;
|
||||
}
|
||||
|
||||
//Move values
|
||||
Container v2;
|
||||
std::copy(v.begin(), v.end(), boost::back_move_inserter(v2));
|
||||
//Move values
|
||||
Container v2;
|
||||
if(use_move_iterator){
|
||||
::boost::copy_or_move( boost::make_move_iterator(v.begin())
|
||||
, boost::make_move_iterator(v.end())
|
||||
, boost::back_move_inserter(v2));
|
||||
}
|
||||
else{
|
||||
std::copy(v.begin(), v.end(), boost::back_move_inserter(v2));
|
||||
}
|
||||
|
||||
//Test values have been moved
|
||||
if(!v.begin()->moved()){
|
||||
return 1;
|
||||
}
|
||||
//Test values have been moved
|
||||
if(!v.begin()->moved()){
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(v2.size() != 10){
|
||||
return 1;
|
||||
}
|
||||
if(v2.size() != 10){
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(v2.begin()->moved()){
|
||||
return 1;
|
||||
if(v2.begin()->moved()){
|
||||
return 1;
|
||||
}
|
||||
done = use_move_iterator;
|
||||
use_move_iterator = true;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user