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

Function make_input_subrange

include/boost/parser/parser.hpp:2740–2774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2738
2739 template<typename R>
2740 constexpr auto make_input_subrange(R && r) noexcept
2741 {
2742 using r_t = remove_cv_ref_t<R>;
2743 if constexpr (std::is_pointer_v<r_t>) {
2744 using value_type = iter_value_t<r_t>;
2745 if constexpr (std::is_same_v<value_type, char>) {
2746 return BOOST_PARSER_SUBRANGE(r, text::null_sentinel);
2747 } else {
2748 return r | text::as_utf32;
2749 }
2750 } else {
2751 using value_type = range_value_t<r_t>;
2752 if constexpr (text::detail::is_bounded_array_v<r_t>) {
2753 if constexpr (std::is_same_v<value_type, char>) {
2754 auto first = detail::text::detail::begin(r);
2755 auto last = detail::text::detail::end(r);
2756 if (first != last && !*std::prev(last))
2757 --last;
2758 return BOOST_PARSER_SUBRANGE(first, last);
2759 } else {
2760 return r | text::as_utf32;
2761 }
2762 } else {
2763 if constexpr (
2764 std::is_same_v<value_type, char> &&
2765 !is_utf8_view<r_t>::value) {
2766 return BOOST_PARSER_SUBRANGE(
2767 detail::text::detail::begin(r),
2768 detail::text::detail::end(r));
2769 } else {
2770 return r | text::as_utf32;
2771 }
2772 }
2773 }
2774 }
2775
2776 template<typename R>
2777 constexpr auto make_view_begin(R & r) noexcept

Callers 2

parser.hppFile · 0.85
attributeClass · 0.85

Calls 3

prevFunction · 0.85
beginFunction · 0.70
endFunction · 0.70

Tested by

no test coverage detected