Add (negative) tests for default constructability (refs #86)

This commit is contained in:
Peter Dimov
2022-07-26 21:35:33 +03:00
parent 1558aaa789
commit ede243c42f

View File

@ -12,6 +12,11 @@ struct X
{
};
struct Y
{
Y( int );
};
int main()
{
{
@ -37,5 +42,17 @@ int main()
BOOST_TEST( !r.has_error() );
}
{
BOOST_TEST_TRAIT_TRUE((std::is_default_constructible<result<int>>));
BOOST_TEST_TRAIT_TRUE((std::is_default_constructible<result<int, int>>));
BOOST_TEST_TRAIT_TRUE((std::is_default_constructible<result<X>>));
BOOST_TEST_TRAIT_TRUE((std::is_default_constructible<result<X, int>>));
BOOST_TEST_TRAIT_TRUE((std::is_default_constructible<result<void>>));
BOOST_TEST_TRAIT_TRUE((std::is_default_constructible<result<void, int>>));
BOOST_TEST_TRAIT_FALSE((std::is_default_constructible<result<Y>>));
BOOST_TEST_TRAIT_FALSE((std::is_default_constructible<result<Y, int>>));
}
return boost::report_errors();
}