• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/detail/has_duplicates.hpp>
6 #include <boost/hana/integral_constant.hpp>
7 namespace hana = boost::hana;
8 
9 
10 static_assert(!hana::detail::has_duplicates<>::value, "");
11 
12 static_assert(!hana::detail::has_duplicates<
13     hana::int_<0>
14 >::value, "");
15 
16 static_assert(!hana::detail::has_duplicates<
17     hana::int_<0>, hana::int_<1>
18 >::value, "");
19 
20 static_assert(!hana::detail::has_duplicates<
21     hana::int_<0>, hana::int_<1>, hana::int_<2>
22 >::value, "");
23 
24 static_assert(hana::detail::has_duplicates<
25     hana::int_<0>, hana::int_<0>, hana::int_<2>
26 >::value, "");
27 
28 static_assert(hana::detail::has_duplicates<
29     hana::int_<0>, hana::int_<1>, hana::int_<0>
30 >::value, "");
31 
32 static_assert(hana::detail::has_duplicates<
33     hana::int_<0>, hana::int_<1>, hana::int_<2>, hana::int_<1>
34 >::value, "");
35 
36 static_assert(hana::detail::has_duplicates<
37     hana::int_<0>, hana::int_<1>, hana::int_<2>, hana::int_<2>
38 >::value, "");
39 
40 static_assert(hana::detail::has_duplicates<
41     hana::int_<0>, hana::int_<1>, hana::int_<2>, hana::int_<1>, hana::int_<1>
42 >::value, "");
43 
44 static_assert(hana::detail::has_duplicates<
45     hana::int_<0>, hana::int_<1>, hana::int_<2>, hana::int_<1>, hana::int_<2>
46 >::value, "");
47 
48 // Make sure it uses deep equality
49 static_assert(hana::detail::has_duplicates<
50     hana::int_<0>, hana::long_<0>, hana::int_<2>, hana::int_<3>
51 >::value, "");
52 
53 static_assert(hana::detail::has_duplicates<
54     hana::int_<0>, hana::int_<1>, hana::int_<2>, hana::long_<1>
55 >::value, "");
56 
main()57 int main() { }
58