Enable tests that doesn't requires rv-ref.

This commit is contained in:
Kohei Takahashi
2017-06-13 20:11:25 +09:00
committed by Andrzej Krzemienski
parent 4fe57f57fa
commit 61bf382ffa

View File

@ -24,6 +24,14 @@
using boost::optional;
using boost::make_optional;
using boost::core::is_same;
template <typename Expected, typename Deduced>
void verify_type(Deduced)
{
BOOST_TEST_TRAIT_TRUE(( is_same<Expected, Deduced> ));
}
#if (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
struct MoveOnly
{
@ -42,14 +50,6 @@ MoveOnly makeMoveOnly(int i)
return MoveOnly(i);
}
using boost::core::is_same;
template <typename Expected, typename Deduced>
void verify_type(Deduced)
{
BOOST_TEST_TRAIT_TRUE(( is_same<Expected, Deduced> ));
}
void test_make_optional_for_move_only_type()
{
verify_type< optional<MoveOnly> >(make_optional(makeMoveOnly(2)));
@ -67,6 +67,8 @@ void test_make_optional_for_move_only_type()
BOOST_TEST (!oN);
}
#endif // !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
void test_make_optional_for_optional()
{
optional<int> oi;
@ -108,8 +110,6 @@ void test_nested_make_optional()
BOOST_TEST (!oo4);
}
#endif // !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
int main()
{
#if (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)