diff --git a/doc/lightweight_test.qbk b/doc/lightweight_test.qbk index 8884239..4c1fa9d 100644 --- a/doc/lightweight_test.qbk +++ b/doc/lightweight_test.qbk @@ -1,7 +1,7 @@ [/ Copyright 2010, 2011 Beman Dawes Copyright 2013 Ion Gaztanaga - Copyright 2014, 2017 Peter Dimov + Copyright 2014-2019 Peter Dimov Copyright 2017 Kohei Takahashi Distributed under the Boost Software License, Version 1.0. @@ -253,6 +253,7 @@ return a boolean value. `` #define BOOST_TEST_TRAIT_TRUE((Trait)) /*unspecified*/ #define BOOST_TEST_TRAIT_FALSE((Trait)) /*unspecified*/ +#define BOOST_TEST_TRAIT_SAME(Type1, Type2) /*unspecified*/ `` [endsect] @@ -280,6 +281,20 @@ message containing `Trait`. Note the double set of parentheses. [endsect] +[section BOOST_TEST_TRAIT_SAME] + +`` +BOOST_TEST_TRAIT_SAME(Type1, Type2) +`` + +If the two types are not the same, increases the error count and outputs a +message containing them. This macro requires that the compiler supports +variadic macros and `__VA_ARGS__`. (Note that unlike `BOOST_TEST_TRAIT_TRUE` +and `BOOST_TEST_TRAIT_FALSE`, this macro only requires a single set of +parentheses.) + +[endsect] + [section Example] `` @@ -297,6 +312,8 @@ int main() { BOOST_TEST_TRAIT_TRUE(( is_same::type, int> )); + BOOST_TEST_TRAIT_SAME( X::type, int ); + return boost::report_errors(); } ``