mirror of
https://github.com/boostorg/optional.git
synced 2025-07-29 12:07:21 +02:00
Drop dependency on Boost.StaticAssert
This commit is contained in:
@ -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() { }
|
||||
|
Reference in New Issue
Block a user