• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Test for lightweight_test_trait.hpp
3 //
4 // Copyright (c) 2014 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 template<class T1, class T2> struct Y1
14 {
15     enum { value = 1 };
16 };
17 
18 template<class T1, class T2> struct Y2
19 {
20     enum { value = 0 };
21 };
22 
23 struct X1
24 {
25     typedef int type;
26 };
27 
28 struct X2
29 {
30     typedef int type;
31 };
32 
main()33 int main()
34 {
35     // BOOST_TEST_TRAIT_TRUE
36 
37     BOOST_TEST_TRAIT_TRUE(( Y1<X1::type, X2::type> ));
38 
39     // BOOST_TEST_TRAIT_FALSE
40 
41     BOOST_TEST_TRAIT_FALSE(( Y2<X1::type, X2::type> ));
42 
43     return boost::report_errors();
44 }
45