Ticket #7031: (back_|front_)move_insert_iterator::op= cannot take rvalue

[SVN r79432]
This commit is contained in:
Ion Gaztañaga
2012-07-11 22:35:00 +00:00
parent 34009be499
commit bdd17fdc07
2 changed files with 34 additions and 20 deletions

View File

@ -789,8 +789,9 @@ Many thanks to all boosters that have tested, reviewed and improved the library.
[section:release_notes_boost_1_51_00 Boost 1.51 Release]
* Fixed bug
[@https://svn.boost.org/trac/boost/ticket/7095 #7095].
* Fixed bugs
[@https://svn.boost.org/trac/boost/ticket/7095 #7095],
[@https://svn.boost.org/trac/boost/ticket/7031 #7031].
[endsect]

View File

@ -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;
}