mirror of
https://github.com/boostorg/optional.git
synced 2025-07-16 22:02:07 +02:00
Test case for #43
This commit is contained in:
committed by
Andrzej Krzemienski
parent
6e10173a44
commit
cbf3cd05af
@ -25,6 +25,8 @@ int main()
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
struct NotDefaultConstructible
|
struct NotDefaultConstructible
|
||||||
{
|
{
|
||||||
NotDefaultConstructible() = delete;
|
NotDefaultConstructible() = delete;
|
||||||
@ -37,9 +39,37 @@ void test_tc_base()
|
|||||||
BOOST_TEST(boost::none == o);
|
BOOST_TEST(boost::none == o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct S
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
struct W
|
||||||
|
{
|
||||||
|
T& t_;
|
||||||
|
|
||||||
|
template<class... Args>
|
||||||
|
W(Args&&... args)
|
||||||
|
: t_(std::forward<Args>(args)...)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void test_value_init()
|
||||||
|
{
|
||||||
|
{
|
||||||
|
S s;
|
||||||
|
W<S> w{s};
|
||||||
|
}
|
||||||
|
boost::optional<W<S&> > o;
|
||||||
|
BOOST_TEST(boost::none == o);
|
||||||
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
test_tc_base();
|
test_tc_base();
|
||||||
|
test_value_init();
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user