2
0
mirror of https://github.com/boostorg/hana.git synced 2026-02-23 03:42:09 +00:00
Files
hana/test/searchable/lookup.cpp
2014-07-19 18:58:14 -04:00

30 lines
772 B
C++

/*
@copyright Louis Dionne 2014
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/searchable/find_mcd.hpp>
#include <boost/hana/detail/minimal/searchable.hpp>
#include <boost/hana/detail/static_assert.hpp>
#include <boost/hana/integral.hpp>
#include <boost/hana/maybe.hpp>
using namespace boost::hana;
template <int i>
constexpr auto x = int_<i>;
template <typename mcd>
void test() {
constexpr auto searchable = detail::minimal::searchable<mcd>;
BOOST_HANA_STATIC_ASSERT(lookup(x<0>, searchable(x<0>)) == just(x<0>));
BOOST_HANA_STATIC_ASSERT(lookup(x<1>, searchable(x<0>)) == nothing);
};
int main() {
test<Searchable::find_mcd>();
}