• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 /*
3 Copyright Barrett Adair 2016-2017
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENSE.md or copy at http ://boost.org/LICENSE_1_0.txt)
6 */
7 
8 #include <type_traits>
9 #include <boost/callable_traits/detail/qualifier_flags.hpp>
10 #include "test.hpp"
11 
12 
13 using namespace boost::callable_traits;
14 using namespace boost::callable_traits::detail;
15 
main()16 int main() {
17 
18     // boost::callable_traits::detail::collapse_flags emulates the C++11
19     // reference collapsing rules. Here, we test that behavior.
20 
21     using rref_plus_lref = collapse_flags<rref_, lref_>;
22     CT_ASSERT(rref_plus_lref::value == lref_);
23 
24     using lref_plus_rref = collapse_flags<lref_, rref_>;
25     CT_ASSERT(lref_plus_rref::value == lref_);
26 
27     using lref_plus_lref = collapse_flags<lref_, lref_>;
28     CT_ASSERT(lref_plus_lref::value == lref_);
29 
30     using rref_plus_rref = collapse_flags<rref_, rref_>;
31     CT_ASSERT(rref_plus_rref::value == rref_);
32 
33     using const_plus_rref = collapse_flags<const_, rref_>;
34     CT_ASSERT(const_plus_rref::value == (const_ | rref_));
35 
36     using const_plus_lref = collapse_flags<const_, lref_>;
37     CT_ASSERT(const_plus_lref::value == (const_ | lref_));
38 }
39