Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions test/optional_test_make_optional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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)));
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down