36 template <std::
size_t Index, std::
size_t Max>
37 struct tuple_all_neq_t
39 template <
typename Tuple1T,
typename Tuple2T>
40 bool operator()(Tuple1T&& t1, Tuple2T&& t2)
43 std::get<Index>(std::forward<Tuple1T>(t1)) !=
44 std::get<Index>(std::forward<Tuple2T>(t2)) &&
45 tuple_all_neq_t<Index + 1, Max>{} (
46 std::forward<Tuple1T>(t1),
47 std::forward<Tuple2T>(t2));
51 template <std::
size_t Max>
52 struct tuple_all_neq_t<Max, Max>
54 template <
typename Tuple1T,
typename Tuple2T>
55 bool operator()(Tuple1T&&, Tuple2T&&)
61 template <
typename Tuple1T,
typename Tuple2T>
62 bool tuple_all_neq(Tuple1T&& t1, Tuple2T&& t2)
64 constexpr
auto size1 = std::tuple_size<estd::decay_t<Tuple1T> >{};
65 constexpr
auto size2 = std::tuple_size<estd::decay_t<Tuple2T> >{};
66 static_assert(size1 == size2,
"");
68 using impl_t = tuple_all_neq_t<0u, (size1 > size2 ? size2 : size1)>;
71 std::forward<Tuple1T>(t1),
72 std::forward<Tuple2T>(t2));
C++ amazing templates and reusable implementations awesomeness.