Drop dependency on Boost.StaticAssert

This commit is contained in:
Andrzej Krzemienski
2024-10-16 23:26:44 +02:00
parent b2c7f93ead
commit e601f1ef2d
11 changed files with 78 additions and 82 deletions

View File

@ -21,29 +21,29 @@ using boost::optional;
struct X {};
struct Y {};
struct Resource
{
explicit Resource(const X&) {}
};
BOOST_STATIC_ASSERT(( boost::is_constructible<Resource, const X&>::value ));
BOOST_STATIC_ASSERT(( !boost::is_constructible<Resource, const Y&>::value ));
static_assert(( boost::is_constructible<Resource, const X&>::value ), "ERROR");
static_assert(( !boost::is_constructible<Resource, const Y&>::value ), "ERROR");
BOOST_STATIC_ASSERT(( boost::is_constructible<optional<Resource>, const X&>::value ));
BOOST_STATIC_ASSERT(( !boost::is_constructible<optional<Resource>, const Y&>::value ));
static_assert(( boost::is_constructible<optional<Resource>, const X&>::value ), "ERROR");
static_assert(( !boost::is_constructible<optional<Resource>, const Y&>::value ), "ERROR");
#ifndef BOOST_OPTIONAL_DETAIL_NO_SFINAE_FRIENDLY_CONSTRUCTORS
BOOST_STATIC_ASSERT(( boost::is_constructible< optional< optional<int> >, optional<int> >::value ));
BOOST_STATIC_ASSERT(( !boost::is_constructible< optional<int>, optional< optional<int> > >::value ));
static_assert(( boost::is_constructible< optional< optional<int> >, optional<int> >::value ), "ERROR");
static_assert(( !boost::is_constructible< optional<int>, optional< optional<int> > >::value ), "ERROR");
BOOST_STATIC_ASSERT(( boost::is_constructible< optional< optional<int> >, const optional<int>& >::value ));
BOOST_STATIC_ASSERT(( !boost::is_constructible< optional<int>, const optional< optional<int> >& >::value ));
static_assert(( boost::is_constructible< optional< optional<int> >, const optional<int>& >::value ), "ERROR");
static_assert(( !boost::is_constructible< optional<int>, const optional< optional<int> >& >::value ), "ERROR");
BOOST_STATIC_ASSERT(( boost::is_constructible<optional<Resource>, const optional<X>&>::value ));
BOOST_STATIC_ASSERT(( !boost::is_constructible<optional<Resource>, const optional<Y>&>::value ));
static_assert(( boost::is_constructible<optional<Resource>, const optional<X>&>::value ), "ERROR");
static_assert(( !boost::is_constructible<optional<Resource>, const optional<Y>&>::value ), "ERROR");
#endif
#endif
int main() { }