mirror of
https://github.com/boostorg/optional.git
synced 2025-07-15 05:16:36 +02:00
Enable tests that doesn't requires rv-ref.
This commit is contained in:
committed by
Andrzej Krzemienski
parent
4fe57f57fa
commit
61bf382ffa
@ -24,6 +24,14 @@
|
|||||||
using boost::optional;
|
using boost::optional;
|
||||||
using boost::make_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)
|
#if (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
|
||||||
struct MoveOnly
|
struct MoveOnly
|
||||||
{
|
{
|
||||||
@ -42,14 +50,6 @@ MoveOnly makeMoveOnly(int i)
|
|||||||
return MoveOnly(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()
|
void test_make_optional_for_move_only_type()
|
||||||
{
|
{
|
||||||
verify_type< optional<MoveOnly> >(make_optional(makeMoveOnly(2)));
|
verify_type< optional<MoveOnly> >(make_optional(makeMoveOnly(2)));
|
||||||
@ -67,6 +67,8 @@ void test_make_optional_for_move_only_type()
|
|||||||
BOOST_TEST (!oN);
|
BOOST_TEST (!oN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
void test_make_optional_for_optional()
|
void test_make_optional_for_optional()
|
||||||
{
|
{
|
||||||
optional<int> oi;
|
optional<int> oi;
|
||||||
@ -108,8 +110,6 @@ void test_nested_make_optional()
|
|||||||
BOOST_TEST (!oo4);
|
BOOST_TEST (!oo4);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#if (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
|
#if (!defined BOOST_OPTIONAL_DETAIL_NO_RVALUE_REFERENCES)
|
||||||
|
Reference in New Issue
Block a user