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

Class as_utf_impl

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

Source from the content-addressed store, hash-verified

726
727 template<template<class> class View, format Format>
728 struct as_utf_impl : stl_interfaces::range_adaptor_closure<as_utf_impl<View, Format>>
729 {
730#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS
731 template<class R>
732 requires is_utf_view<std::remove_cvref_t<R>> ||
733 (std::ranges::viewable_range<R> &&
734 can_utf_view<unpacked_range<R>, View>)
735#else
736 template<typename R>
737#endif
738 [[nodiscard]] constexpr auto operator()(R && r) const
739 {
740 using T = detail::remove_cv_ref_t<R>;
741 if constexpr (detail::is_empty_view<T>) {
742#if BOOST_PARSER_DETAIL_TEXT_USE_CONCEPTS
743 return std::ranges::empty_view<format_to_type_t<Format>>{};
744#else
745 return 42; // Never gonna happen.
746#endif
747 } else if constexpr (is_utf_view<T>) {
748 return View(std::forward<R>(r).base());
749 } else if constexpr (detail::is_charn_view<T>) {
750 return View(std::forward<R>(r));
751 } else {
752 return View(detail::unpack_range(std::forward<R>(r)));
753 }
754 }
755 };
756
757 template<class T>
758 constexpr bool is_utf32_view = false;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected