1 // Copyright Louis Dionne 2013-2017
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
4 
5 #include <boost/hana/assert.hpp>
6 #include <boost/hana/is_disjoint.hpp>
7 #include <boost/hana/map.hpp>
8 #include <boost/hana/not.hpp>
9 #include <boost/hana/set.hpp>
10 #include <boost/hana/tuple.hpp>
11 #include <boost/hana/type.hpp>
12 
13 #include <string>
14 namespace hana = boost::hana;
15 using namespace std::literals;
16 
17 
main()18 int main() {
19     // Tuples
20     auto xs = hana::make_tuple(hana::int_c<1>, "alfa"s, hana::type_c<int>);
21     auto ys = hana::make_tuple(hana::type_c<void>, hana::int_c<3>, "bravo"s);
22     BOOST_HANA_RUNTIME_CHECK(hana::is_disjoint(xs, ys));
23 
24     // Sets
25     auto s1 = hana::make_set(hana::int_c<1>, hana::type_c<void>, hana::int_c<2>);
26     auto s2 = hana::make_set(hana::type_c<char>, hana::type_c<int>, hana::int_c<1>);
27     BOOST_HANA_CONSTANT_CHECK(!hana::is_disjoint(s1, s2));
28 
29     // Maps
30     auto vowels = hana::make_map(
31         hana::make_pair(hana::char_c<'a'>, "alfa"s),
32         hana::make_pair(hana::char_c<'e'>, "echo"s),
33         hana::make_pair(hana::char_c<'i'>, "india"s)
34         // ...
35     );
36 
37     auto consonants = hana::make_map(
38         hana::make_pair(hana::char_c<'b'>, "bravo"s),
39         hana::make_pair(hana::char_c<'c'>, "charlie"s),
40         hana::make_pair(hana::char_c<'f'>, "foxtrot"s)
41         // ...
42     );
43 
44     BOOST_HANA_CONSTANT_CHECK(hana::is_disjoint(vowels, consonants));
45 }
46