MCPcopy Create free account
hub / github.com/boostorg/hana / main

Function main

example/optional/applicative.complex.cpp:40–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38BOOST_HANA_CONSTEXPR_LAMBDA auto evaluate = hana::ap(function<op>, digit<x>, digit<y>);
39
40int main() {
41 BOOST_HANA_CONSTEXPR_CHECK(evaluate<'1', '+', '2'> == hana::just(1 + 2));
42 BOOST_HANA_CONSTEXPR_CHECK(evaluate<'4', '-', '2'> == hana::just(4 - 2));
43
44 BOOST_HANA_CONSTANT_CHECK(evaluate<'?', '+', '2'> == hana::nothing);
45 BOOST_HANA_CONSTANT_CHECK(evaluate<'1', '?', '2'> == hana::nothing);
46 BOOST_HANA_CONSTANT_CHECK(evaluate<'1', '+', '?'> == hana::nothing);
47 BOOST_HANA_CONSTANT_CHECK(evaluate<'?', '?', '?'> == hana::nothing);
48
49 static_assert(hana::lift<hana::optional_tag>(123) == hana::just(123), "");
50}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected