mirror of
https://github.com/boostorg/hana.git
synced 2026-02-15 01:02:10 +00:00
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
/*
|
|
@copyright Louis Dionne 2015
|
|
Distributed under the Boost Software License, Version 1.0.
|
|
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
|
*/
|
|
|
|
#include <boost/hana/tuple.hpp>
|
|
|
|
#include <laws/base.hpp>
|
|
#include <laws/searchable.hpp>
|
|
using namespace boost::hana;
|
|
|
|
|
|
// This test is in its own file to avoid crashing the compiler.
|
|
|
|
template <int i>
|
|
using eq = test::ct_eq<i>;
|
|
|
|
int main() {
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// Setup for the laws below
|
|
//////////////////////////////////////////////////////////////////////////
|
|
auto eq_tuples = make<Tuple>(
|
|
make<Tuple>()
|
|
, make<Tuple>(eq<0>{})
|
|
, make<Tuple>(eq<0>{}, eq<1>{})
|
|
, make<Tuple>(eq<0>{}, eq<1>{}, eq<2>{})
|
|
, make<Tuple>(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}, eq<4>{}, eq<5>{})
|
|
);
|
|
|
|
auto eq_tuple_keys = make<Tuple>(
|
|
eq<3>{}, eq<5>{}, eq<7>{}
|
|
);
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// Searchable
|
|
//////////////////////////////////////////////////////////////////////////
|
|
{
|
|
test::TestSearchable<Tuple>{eq_tuples, eq_tuple_keys};
|
|
}
|
|
}
|