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

Function main

test/meta_test.cpp:22–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20namespace mp11 = boost::mp11;
21
22int main() {
23 // literals
24 {
25 auto j0 = 0_c;
26 auto j3 = 3_c;
27 auto j10 = 10_c;
28 auto j213 = 213_c;
29 BOOST_TEST_TRAIT_TRUE((std::is_same<i0, decltype(j0)>));
30 BOOST_TEST_TRAIT_TRUE((std::is_same<i3, decltype(j3)>));
31 BOOST_TEST_EQ(decltype(j10)::value, 10);
32 BOOST_TEST_EQ(decltype(j213)::value, 213);
33 }
34
35 // has_variance_support
36 {
37 struct no_methods {};
38
39 struct value_method {
40 void value() {}
41 };
42
43 struct variance_method {
44 void variance() {}
45 };
46
47 struct value_and_variance_methods {
48 void value() {}
49 void variance() {}
50 };
51
52 BOOST_TEST_TRAIT_FALSE((has_variance_support<no_methods>));
53 BOOST_TEST_TRAIT_FALSE((has_variance_support<value_method>));
54 BOOST_TEST_TRAIT_FALSE((has_variance_support<variance_method>));
55 BOOST_TEST_TRAIT_TRUE((has_variance_support<value_and_variance_methods>));
56 }
57
58 // has_method_lower
59 {
60 struct no_methods {};
61 struct lower_method {
62 void lower(int) {}
63 };
64
65 BOOST_TEST_TRAIT_FALSE((has_method_lower<no_methods>));
66 BOOST_TEST_TRAIT_TRUE((has_method_lower<lower_method>));
67 }
68
69 // classify_container
70 {
71 using result1 = classify_container<int>;
72 BOOST_TEST_TRAIT_TRUE((std::is_same<result1, no_container_tag>));
73
74 using result1a = classify_container<int&>;
75 BOOST_TEST_TRAIT_TRUE((std::is_same<result1a, no_container_tag>));
76
77 using result2 = classify_container<std::vector<int>>;
78 BOOST_TEST_TRAIT_TRUE((std::is_same<result2, dynamic_container_tag>));
79

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected