#include <boost/move/utility_core.hpp>
#include <iostream>
class copyable_only_tester
{
public:
copyable_only_tester()
{ std::cout << "copyable_only_tester()" << std::endl; }
copyable_only_tester(const copyable_only_tester&)
{ std::cout << "copyable_only_tester(const copyable_only_tester&)" << std::endl; }
copyable_only_tester(int)
{ std::cout << "copyable_only_tester(int)" << std::endl; }
copyable_only_tester(int, double)
{ std::cout << "copyable_only_tester(int, double)" << std::endl; }
};
class copyable_movable_tester
{
BOOST_COPYABLE_AND_MOVABLE(copyable_movable_tester)
public:
copyable_movable_tester()
{ std::cout << "copyable_movable_tester()" << std::endl; }
copyable_movable_tester(int)
{ std::cout << "copyable_movable_tester(int)" << std::endl; }
copyable_movable_tester(BOOST_RV_REF(copyable_movable_tester))
{ std::cout << "copyable_movable_tester(BOOST_RV_REF(copyable_movable_tester))" << std::endl; }
copyable_movable_tester(const copyable_movable_tester &)
{ std::cout << "copyable_movable_tester(const copyable_movable_tester &)" << std::endl; }
copyable_movable_tester(BOOST_RV_REF(copyable_movable_tester), BOOST_RV_REF(copyable_movable_tester))
{ std::cout << "copyable_movable_tester(BOOST_RV_REF(copyable_movable_tester), BOOST_RV_REF(copyable_movable_tester))" << std::endl; }
copyable_movable_tester &operator=(BOOST_RV_REF(copyable_movable_tester))
{ std::cout << "copyable_movable_tester & operator=(BOOST_RV_REF(copyable_movable_tester))" << std::endl;
return *this; }
copyable_movable_tester &operator=(BOOST_COPY_ASSIGN_REF(copyable_movable_tester))
{ std::cout << "copyable_movable_tester & operator=(BOOST_COPY_ASSIGN_REF(copyable_movable_tester))" << std::endl;
return *this; }
};
template<class MaybeMovable, class MaybeRv>
void function_construct(BOOST_FWD_REF(MaybeRv) x)
{ MaybeMovable m(boost::forward<MaybeRv>(x)); }
template<class MaybeMovable, class MaybeRv, class MaybeRv2>
void function_construct(BOOST_FWD_REF(MaybeRv) x, BOOST_FWD_REF(MaybeRv2) x2)
{ MaybeMovable m(boost::forward<MaybeRv>(x), boost::forward<MaybeRv2>(x2)); }
int main()
{
copyable_movable_tester m;
function_construct<copyable_movable_tester>(boost::move(m));
function_construct<copyable_movable_tester>(copyable_movable_tester());
function_construct<copyable_movable_tester>(boost::move(m), boost::move(m));
copyable_only_tester nm;
function_construct<copyable_only_tester>(boost::move(nm));
function_construct<copyable_only_tester>(nm);
function_construct<copyable_only_tester>(int(0));
function_construct<copyable_only_tester>(int(0), double(0.0));
return 0;
}