detail/test/is_xxx_test.cpp
Daniel James adaa82e03e Add some tests
Test classes which I'm going to remove the MPL dependency from: blank,
allocator_utilities, is_xxx and reference_content.  I'm also going to change
indirect_traits, but that's tested in the python module.
2018-04-08 20:55:38 +01:00

24 lines
872 B
C++

// Copyright 2018 Daniel James.
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/detail/is_xxx.hpp>
#include <boost/static_assert.hpp>
namespace is_xxx_test {
template <typename T> struct thing1 {};
template <typename T1, typename T2 = int> struct thing2 {};
}
BOOST_DETAIL_IS_XXX_DEF(thing1, is_xxx_test::thing1, 1);
BOOST_DETAIL_IS_XXX_DEF(thing2, is_xxx_test::thing2, 2);
BOOST_STATIC_ASSERT((is_thing1<is_xxx_test::thing1<int> >::value));
BOOST_STATIC_ASSERT((!is_thing1<is_xxx_test::thing2<int> >::value));
BOOST_STATIC_ASSERT((!is_thing2<is_xxx_test::thing1<int> >::value));
BOOST_STATIC_ASSERT((is_thing2<is_xxx_test::thing2<int> >::value));
BOOST_STATIC_ASSERT((is_thing2<is_xxx_test::thing2<int, float> >::value));
int main() {}