• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Test for BOOST_TEST_TRAIT_SAME
3 //
4 // Copyright 2014, 2019 Peter Dimov
5 //
6 // Distributed under the Boost Software License, Version 1.0.
7 // See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt
9 //
10 
11 #include <boost/core/lightweight_test_trait.hpp>
12 
13 struct X
14 {
15     typedef int type;
16 };
17 
18 template<class T1, class T2> struct Y
19 {
20     typedef T1 type;
21 };
22 
main()23 int main()
24 {
25     BOOST_TEST_TRAIT_SAME(X, X);
26     BOOST_TEST_TRAIT_SAME(void, void);
27     BOOST_TEST_TRAIT_SAME(char[1], char[1]);
28     BOOST_TEST_TRAIT_SAME(char[], char[]);
29     BOOST_TEST_TRAIT_SAME(void(), void());
30     BOOST_TEST_TRAIT_SAME(X::type, X::type);
31     BOOST_TEST_TRAIT_SAME(X::type, Y<int, float>::type);
32     BOOST_TEST_TRAIT_SAME(Y<int, float>, Y<int, float>);
33     BOOST_TEST_TRAIT_SAME(Y<void, float>::type, void);
34 
35     return boost::report_errors();
36 }
37