mirror of
https://github.com/boostorg/core.git
synced 2025-07-29 20:37:22 +02:00
Document BOOST_TEST_TRAIT_SAME
This commit is contained in:
@ -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<X<int, long>::type, int> ));
|
||||
|
||||
BOOST_TEST_TRAIT_SAME( X<int, long>::type, int );
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
``
|
||||
|
Reference in New Issue
Block a user