#include <boost/move/iterator.hpp>
#include <boost/container/list.hpp>
#include "movable.hpp"
#include <cassert>
#include <algorithm>
using namespace ::boost::container;
typedef list<movable> list_t;
typedef list_t::iterator l_iterator;
template<class MoveInsertIterator>
void test_move_inserter(list_t &l2, MoveInsertIterator mit)
{
list<movable> l(10);
assert(!l.begin()->moved());
l2.clear();
std::copy(l.begin(), l.end(), mit);
assert(l2.size() == l.size());
assert(l.begin()->moved());
assert(!l2.begin()->moved());
}
int main()
{
list_t l2;
test_move_inserter(l2, boost::back_move_inserter(l2));
test_move_inserter(l2, boost::front_move_inserter(l2));
test_move_inserter(l2, boost::move_inserter(l2, l2.end()));
return 0;
}