mirror of
https://github.com/boostorg/move.git
synced 2025-08-01 05:14:27 +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 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]
|
[section:release_notes_boost_1_49_00 Boost 1.49 Release]
|
||||||
|
|
||||||
* Fixed bugs
|
* Fixed bugs
|
||||||
|
@@ -17,29 +17,42 @@
|
|||||||
template<class Container>
|
template<class Container>
|
||||||
int move_test()
|
int move_test()
|
||||||
{
|
{
|
||||||
//Default construct 10 movable objects
|
bool use_move_iterator = false;
|
||||||
Container v(10);
|
bool done = false;
|
||||||
|
while(!done){
|
||||||
|
//Default construct 10 movable objects
|
||||||
|
Container v(10);
|
||||||
|
|
||||||
//Test default constructed value
|
//Test default constructed value
|
||||||
if(v.begin()->moved()){
|
if(v.begin()->moved()){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Move values
|
//Move values
|
||||||
Container v2;
|
Container v2;
|
||||||
std::copy(v.begin(), v.end(), boost::back_move_inserter(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
|
//Test values have been moved
|
||||||
if(!v.begin()->moved()){
|
if(!v.begin()->moved()){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(v2.size() != 10){
|
if(v2.size() != 10){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(v2.begin()->moved()){
|
if(v2.begin()->moved()){
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
done = use_move_iterator;
|
||||||
|
use_move_iterator = true;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user