MCPcopy Create free account
hub / github.com/boostorg/parser / compile_all_t

Function compile_all_t

test/compile_all_t.cpp:18–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16using namespace boost::parser::detail::text;
17
18void compile_all_t()
19{
20 {
21 std::string str;
22 std::string const const_str;
23
24 {
25 auto && result = detail::all(
26 BOOST_PARSER_SUBRANGE(const_str.begin(), const_str.end()));
27 static_assert(
28 std::is_same_v<
29 decltype(result),
30 BOOST_PARSER_SUBRANGE<decltype(const_str.begin())> &&>);
31 }
32 {
33 auto && result = detail::all(str);
34 static_assert(std::is_same_v<
35 decltype(result),
36 detail::ref_view<std::string> &&>);
37 }
38 {
39 auto && result = detail::all(const_str);
40 static_assert(std::is_same_v<
41 decltype(result),
42 detail::ref_view<std::string const> &&>);
43 }
44 {
45 auto && result = detail::all(std::string{});
46 static_assert(std::is_same_v<
47 decltype(result),
48 detail::owning_view<std::string> &&>);
49 }
50
51 static_assert(std::is_same_v<
52 detail::all_t<
53 BOOST_PARSER_SUBRANGE<decltype(const_str.begin())>>,
54 BOOST_PARSER_SUBRANGE<decltype(const_str.begin())>>);
55
56 static_assert(std::is_same_v<
57 detail::all_t<std::string &>,
58 detail::ref_view<std::string>>);
59
60 static_assert(std::is_same_v<
61 detail::all_t<std::string const &>,
62 detail::ref_view<std::string const>>);
63
64 static_assert(std::is_same_v<
65 detail::all_t<std::string &&>,
66 detail::owning_view<std::string>>);
67 }
68
69 {
70 char str[] = "text";
71 char const const_str[] = "text";
72
73 static_assert(detail::range_<char[5]>);
74 static_assert(std::is_object_v<char[5]>);
75 detail::ref_view<char[5]> ref_view_(str);

Callers 1

mainFunction · 0.85

Calls 4

beginFunction · 0.50
endFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by 1

mainFunction · 0.68