fixed optional refs test.

I was using default values for function teplate parameters, wchich does not compile in C++03.
This commit is contained in:
Andrzej Krzemienski
2016-02-17 16:26:47 +01:00
parent b0602a1161
commit 414728970a

View File

@ -199,11 +199,11 @@ void test_direct_init_for()
BOOST_TEST_EQ(val(v), 7);
}
template <typename T>
template <typename T, typename U>
void test_clearing_the_value()
{
typename concrete_type_of<T>::type v(2);
optional<T&> o1(v), o2(v);
optional<U&> o1(v), o2(v);
BOOST_TEST(o1);
BOOST_TEST(o1 != none);
@ -220,11 +220,11 @@ void test_clearing_the_value()
BOOST_TEST_EQ(val(v), 2);
}
template <typename T>
template <typename T, typename U>
void test_equality()
{
typename concrete_type_of<T>::type v1(1), v2(2), v2_(2), v3(3);
optional<T&> o1(v1), o2(v2), o2_(v2_), o3(v3), o3_(v3), oN, oN_;
optional<U&> o1(v1), o2(v2), o2_(v2_), o3(v3), o3_(v3), oN, oN_;
// o2 and o2_ point to different objects; o3 and o3_ point to the same object
BOOST_TEST(oN == oN);
@ -256,7 +256,7 @@ void test_equality()
BOOST_TEST( (o2 != oN));
}
template <typename T, typename U = T>
template <typename T, typename U>
void test_order()
{
typename concrete_type_of<T>::type v1(1), v2(2), v2_(2), v3(3);
@ -399,7 +399,7 @@ void test_order()
BOOST_TEST(!(o3_ < oN_));
}
template <typename T, typename U = T>
template <typename T, typename U>
void test_swap()
{
typename concrete_type_of<T>::type v1(1), v2(2);
@ -435,11 +435,11 @@ void test_optional_ref()
{
test_not_containing_value_for<T>();
test_direct_init_for<T>();
test_clearing_the_value<T>();
test_clearing_the_value<T, T>();
test_arrow<T>();
test_equality<T>();
test_order<T>();
test_swap<T>();
test_equality<T, T>();
test_order<T, T>();
test_swap<T, T>();
}
template <typename T>
@ -448,12 +448,15 @@ void test_optional_const_ref()
test_not_containing_value_for<const T>();
test_direct_init_for_const<T>();
test_direct_init_for_noconst_const<T>();
test_clearing_the_value<const T>();
test_clearing_the_value<const T, const T>();
test_clearing_the_value<T, const T>();
test_arrow_const<T>();
test_arrow_noconst_const<T>();
test_equality<const T>();
test_order<const T>();
test_swap<const T>();
test_equality<const T, const T>();
test_equality<T, const T>();
test_order<const T, const T>();
test_order<T, const T>();
test_swap<const T, const T>();
test_swap<T, const T>();
}