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

Class as_charn_impl

include/boost/parser/detail/text/transcode_view.hpp:388–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386 namespace detail {
387 template<template<class> class View, format Format>
388 struct as_charn_impl : stl_interfaces::range_adaptor_closure<as_charn_impl<View, Format>>
389 {
390#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS
391 template<class R>
392 requires (std::ranges::viewable_range<R> &&
393 std::ranges::input_range<R> &&
394 std::convertible_to<std::ranges::range_reference_t<R>, format_to_type_t<Format>>)
395#else
396 template<class R>
397#endif
398 [[nodiscard]] constexpr auto operator()(R && r) const
399 {
400 using T = remove_cv_ref_t<R>;
401 if constexpr (detail::is_empty_view<T>) {
402#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS
403 return std::ranges::empty_view<format_to_type_t<Format>>{};
404#else
405 return 42; // Never gonna happen.
406#endif
407 } else {
408 return View(std::forward<R>(r));
409 }
410 }
411 };
412
413 template<class T>
414 constexpr bool is_charn_view = false;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected