di 0.1.0
Loading...
Searching...
No Matches
into_parser_context.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace di::parser {
7namespace detail {
8 struct IntoParseContextFunction {
9 template<typename T>
10 requires(concepts::TagInvocable<IntoParseContextFunction, T> || concepts::ParserContext<T>)
11 constexpr auto operator()(T&& value) const -> concepts::ParserContext decltype(auto) {
12 if constexpr (concepts::TagInvocable<IntoParseContextFunction, T>) {
13 return function::tag_invoke(*this, util::forward<T>(value));
14 } else {
15 return util::forward<T>(value);
16 }
17 }
18 };
19}
20
21constexpr inline auto into_parser_context = detail::IntoParseContextFunction {};
22}
23
24namespace di::concepts {
25template<typename T>
26concept IntoParserContext = requires(T&& value) { parser::into_parser_context(util::forward<T>(value)); };
27}
28
29namespace di::meta {
30template<concepts::IntoParserContext T>
32}
Definition into_parser_context.h:26
Definition any_storable.h:9
constexpr tag_invoke_detail::TagInvokeFn tag_invoke
Definition tag_invoke.h:22
constexpr auto value
Definition value.h:34
Definition merge_interfaces.h:6
decltype(parser::into_parser_context(util::declval< T >())) AsParserContext
Definition into_parser_context.h:31
Definition code_point_parser.h:10
constexpr auto into_parser_context
Definition into_parser_context.h:21
auto declval() -> meta::AddRValueReference< T >
Definition declval.h:8