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

Function main

test/issues/github_365.cpp:39–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37};
38
39int main() {
40 {
41 Foo foo = {{1.0f, 2.0f, 3.0f}};
42 auto accessors = hana::accessors<Foo>();
43 auto get_array = hana::second(hana::at_c<0>(accessors));
44 static_assert(std::is_same<decltype(get_array(foo)), float(&)[3]>{}, "");
45 float (&array)[3] = get_array(foo);
46 BOOST_HANA_RUNTIME_CHECK(array[0] == 1.0f);
47 BOOST_HANA_RUNTIME_CHECK(array[1] == 2.0f);
48 BOOST_HANA_RUNTIME_CHECK(array[2] == 3.0f);
49 }
50
51 {
52 Bar bar = {{1.0f, 2.0f, 3.0f}};
53 auto accessors = hana::accessors<Bar>();
54 auto get_array = hana::second(hana::at_c<0>(accessors));
55 static_assert(std::is_same<decltype(get_array(bar)), float(&)[3]>{}, "");
56 float (&array)[3] = get_array(bar);
57 BOOST_HANA_RUNTIME_CHECK(array[0] == 1.0f);
58 BOOST_HANA_RUNTIME_CHECK(array[1] == 2.0f);
59 BOOST_HANA_RUNTIME_CHECK(array[2] == 3.0f);
60 }
61}

Callers

nothing calls this directly

Calls 1

secondClass · 0.85

Tested by

no test coverage detected