• 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/map.hpp>
6 
7 #include <laws/base.hpp>
8 #include <support/minimal_product.hpp>
9 #include <type_traits>
10 #include <utility>
11 namespace hana = boost::hana;
12 
13 
14 template <typename ...Pairs>
15 struct check_map {
16     static_assert(std::is_same<
17         hana::map<Pairs...>,
18         decltype(hana::make_map(std::declval<Pairs>()...))
19     >{}, "");
20 };
21 
22 template <int i>
23 using pair = ::product_t<hana::test::ct_eq<i>, hana::test::ct_eq<-i>>;
24 
25 template struct check_map<>;
26 template struct check_map<pair<1>>;
27 template struct check_map<pair<1>, pair<2>>;
28 template struct check_map<pair<1>, pair<2>, pair<3>>;
29 template struct check_map<pair<1>, pair<2>, pair<3>, pair<4>>;
30 template struct check_map<pair<1>, pair<2>, pair<3>, pair<4>, pair<5>>;
31 template struct check_map<pair<1>, pair<2>, pair<3>, pair<4>, pair<5>, pair<6>>;
32 
main()33 int main() { }
34