Fix wrong include

and add tests for move.
This commit is contained in:
Kohei Takahashi
2014-11-17 01:01:56 +09:00
parent 9075da0790
commit 4dd4773d3d
3 changed files with 42 additions and 1 deletions

View File

@ -16,7 +16,7 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/static_assert.hpp> #include <boost/static_assert.hpp>
#include <boost/utility/enable_if.hpp> #include <boost/utility/enable_if.hpp>
#include <boost/mpl/and_.hpp> #include <boost/mpl/and.hpp>
#if defined (BOOST_MSVC) #if defined (BOOST_MSVC)
# pragma warning(push) # pragma warning(push)

View File

@ -32,6 +32,7 @@ project
[ run algorithm/insert.cpp : : : : ] [ run algorithm/insert.cpp : : : : ]
[ run algorithm/insert_range.cpp : : : : ] [ run algorithm/insert_range.cpp : : : : ]
[ run algorithm/iter_fold.cpp : : : : ] [ run algorithm/iter_fold.cpp : : : : ]
[ run algorithm/move.cpp : : : : ]
[ run algorithm/none.cpp : : : : ] [ run algorithm/none.cpp : : : : ]
[ run algorithm/pop_back.cpp : : : : ] [ run algorithm/pop_back.cpp : : : : ]
[ run algorithm/pop_front.cpp : : : : ] [ run algorithm/pop_front.cpp : : : : ]

40
test/algorithm/move.cpp Normal file
View File

@ -0,0 +1,40 @@
/*=============================================================================
Copyright (c) 2014 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#include <boost/config.hpp>
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#include <boost/core/lightweight_test.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/list/list.hpp>
#include <boost/fusion/sequence/comparison.hpp>
#include <boost/fusion/algorithm/auxiliary/move.hpp>
#include <utility>
int main()
{
{
boost::fusion::vector<int, short, double> v(1, 2, 3);
boost::fusion::list<int, short, double> l1 = v;
boost::fusion::list<int, short, double> l2;
boost::fusion::move(std::move(v), l2);
BOOST_TEST(l1 == l2);
}
return boost::report_errors();
}
#else
int main()
{
// no thing to do
}
#endif