#include <boost/move/detail/type_traits.hpp>
#include <boost/move/core.hpp>
#include <boost/core/lightweight_test.hpp>
#if defined(BOOST_MOVE_IS_POD)
struct pod_struct
{
int i;
float f;
};
#endif
#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
struct deleted_copy_and_assign_type
{
deleted_copy_and_assign_type(const deleted_copy_and_assign_type&) = delete;
deleted_copy_and_assign_type & operator=(const deleted_copy_and_assign_type&) = delete;
};
#endif
class boost_move_type
{
BOOST_MOVABLE_BUT_NOT_COPYABLE(boost_move_type)
public:
boost_move_type(BOOST_RV_REF(boost_move_type)){}
boost_move_type & operator=(BOOST_RV_REF(boost_move_type)){ return *this; }
};
namespace is_pod_test
{
void test()
{
BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_pod<int>::value));
#if defined(BOOST_MOVE_IS_POD)
BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_pod<pod_struct>::value));
#endif
}
}
namespace trivially_memcopyable_test {
void test()
{
#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS)
BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_constructible<deleted_copy_and_assign_type>::value));
BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_assignable<deleted_copy_and_assign_type>::value));
#endif BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_constructible<boost_move_type>::value));
BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_trivially_copy_assignable<boost_move_type>::value));
BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_copy_constructible<boost_move_type>::value));
BOOST_MOVE_STATIC_ASSERT(!(boost::move_detail::is_copy_assignable<boost_move_type>::value));
BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_trivially_copy_constructible<int>::value));
BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_trivially_copy_assignable<int>::value));
BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_copy_constructible<int>::value));
BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_copy_assignable<int>::value));
#if defined(BOOST_MOVE_IS_POD)
BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_trivially_copy_constructible<pod_struct>::value));
BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_trivially_copy_assignable<pod_struct>::value));
BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_copy_constructible<pod_struct>::value));
BOOST_MOVE_STATIC_ASSERT((boost::move_detail::is_copy_assignable<pod_struct>::value));
#endif
}
}
int main()
{
trivially_memcopyable_test::test();
is_pod_test::test();
boost::report_errors();
}