1 
2 //  (C) Copyright Edward Diener 2019
3 //  Use, modification and distribution are subject to the Boost Software License,
4 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 //  http://www.boost.org/LICENSE_1_0.txt).
6 
7 //------------------------------------------------------------------------------
8 
9 #include <boost/mpl/assert.hpp>
10 #include <boost/function_types/property_tags.hpp>
11 
12 namespace ft = boost::function_types;
13 namespace mpl = boost::mpl;
14 
15 typedef ft::tag<ft::variadic,ft::non_volatile,ft::non_const,ft::default_cc> tag1;
16 typedef ft::tag<ft::const_non_volatile,ft::const_qualified> tag2;
17 typedef ft::tag<ft::cv_qualified,ft::variadic> tag3;
18 typedef ft::null_tag tag4;
19 typedef ft::tag<ft::variadic,ft::volatile_non_const> tag5;
20 typedef ft::tag<ft::volatile_qualified,ft::non_const,ft::variadic> tag6;
21 typedef ft::tag<ft::non_variadic,ft::const_non_volatile,ft::default_cc> tag7;
22 typedef ft::tag<ft::non_cv,ft::default_cc> tag8;
23 
24 BOOST_MPL_ASSERT((ft::has_property_tag<tag1, ft::variadic>));
25 BOOST_MPL_ASSERT((ft::has_property_tag<tag2, ft::const_qualified>));
26 BOOST_MPL_ASSERT((ft::has_property_tag<tag3, ft::cv_qualified>));
27 BOOST_MPL_ASSERT((ft::has_property_tag<tag4, ft::null_tag>));
28 BOOST_MPL_ASSERT((ft::has_property_tag<tag5, ft::volatile_qualified>));
29 BOOST_MPL_ASSERT((ft::has_property_tag<tag6, ft::volatile_qualified>));
30 BOOST_MPL_ASSERT((ft::has_property_tag<tag7, ft::const_qualified>));
31 BOOST_MPL_ASSERT((ft::has_property_tag<tag8, ft::default_cc>));
32 
33 BOOST_MPL_ASSERT((ft::has_variadic_property_tag<tag1>));
34 BOOST_MPL_ASSERT((ft::has_variadic_property_tag<tag3>));
35 BOOST_MPL_ASSERT((ft::has_variadic_property_tag<tag5>));
36 BOOST_MPL_ASSERT((ft::has_variadic_property_tag<tag6>));
37 BOOST_MPL_ASSERT((ft::has_default_cc_property_tag<tag1>));
38 BOOST_MPL_ASSERT((ft::has_default_cc_property_tag<tag7>));
39 BOOST_MPL_ASSERT((ft::has_default_cc_property_tag<tag8>));
40 BOOST_MPL_ASSERT((ft::has_const_property_tag<tag2>));
41 BOOST_MPL_ASSERT((ft::has_const_property_tag<tag3>));
42 BOOST_MPL_ASSERT((ft::has_const_property_tag<tag7>));
43 BOOST_MPL_ASSERT((ft::has_volatile_property_tag<tag3>));
44 BOOST_MPL_ASSERT((ft::has_volatile_property_tag<tag5>));
45 BOOST_MPL_ASSERT((ft::has_volatile_property_tag<tag6>));
46 BOOST_MPL_ASSERT((ft::has_cv_property_tag<tag3>));
47 BOOST_MPL_ASSERT((ft::has_null_property_tag<tag4>));
48 
49 BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag1, ft::const_qualified>));
50 BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag2, ft::cv_qualified>));
51 BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag3, ft::null_tag>));
52 BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag4, ft::volatile_qualified>));
53 BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag5, ft::const_qualified>));
54 BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag6, ft::default_cc>));
55 BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag7, ft::variadic>));
56 BOOST_MPL_ASSERT_NOT((ft::has_property_tag<tag8, ft::volatile_qualified>));
57 
58 BOOST_MPL_ASSERT_NOT((ft::has_variadic_property_tag<tag2>));
59 BOOST_MPL_ASSERT_NOT((ft::has_default_cc_property_tag<tag6>));
60 BOOST_MPL_ASSERT_NOT((ft::has_const_property_tag<tag4>));
61 BOOST_MPL_ASSERT_NOT((ft::has_const_property_tag<tag5>));
62 BOOST_MPL_ASSERT_NOT((ft::has_volatile_property_tag<tag7>));
63 BOOST_MPL_ASSERT_NOT((ft::has_cv_property_tag<tag1>));
64 BOOST_MPL_ASSERT_NOT((ft::has_null_property_tag<tag8>));
65