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

Function main

example/struct.mcd.nested.cpp:44–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42//! [main]
43
44int main() {
45 Person john{"John", 30}, bob{"Bob", 40};
46 BOOST_HANA_RUNTIME_CHECK(hana::equal(john, john));
47 BOOST_HANA_RUNTIME_CHECK(hana::not_equal(john, bob));
48
49 BOOST_HANA_RUNTIME_CHECK(hana::find(john, BOOST_HANA_STRING("name")) == hana::just("John"));
50 BOOST_HANA_RUNTIME_CHECK(hana::find(john, BOOST_HANA_STRING("age")) == hana::just(30));
51 BOOST_HANA_CONSTANT_CHECK(hana::find(john, BOOST_HANA_STRING("foo")) == hana::nothing);
52
53 BOOST_HANA_RUNTIME_CHECK(hana::to_tuple(john) == hana::make_tuple(
54 hana::make_pair(BOOST_HANA_STRING("name"), "John"),
55 hana::make_pair(BOOST_HANA_STRING("age"), 30)
56 ));
57}

Callers

nothing calls this directly

Calls 2

equalClass · 0.50
findClass · 0.50

Tested by

no test coverage detected