diff options
| author | Rutger Broekhoff | 2026-11-30 23:33:26 +0100 |
|---|---|---|
| committer | Rutger Broekhoff | 2026-11-30 23:33:26 +0100 |
| commit | 4a81c39d94b6877f7753896218467ff77b8d7f6f (patch) | |
| tree | f046f52f4f81e9951b7531d795c169a16e7e6e54 /server/src/xml.cppm | |
| parent | 7bba7176194c4d1d9c7066f8eda7a94491d924e6 (diff) | |
| download | routemon-4a81c39d94b6877f7753896218467ff77b8d7f6f.tar.gz routemon-4a81c39d94b6877f7753896218467ff77b8d7f6f.zip | |
class -> typename
Diffstat (limited to 'server/src/xml.cppm')
| -rw-r--r-- | server/src/xml.cppm | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/server/src/xml.cppm b/server/src/xml.cppm index 2d186da..783b192 100644 --- a/server/src/xml.cppm +++ b/server/src/xml.cppm | |||
| @@ -136,10 +136,10 @@ public: | |||
| 136 | }; | 136 | }; |
| 137 | static_assert(std::ranges::input_range<attribute_view>); | 137 | static_assert(std::ranges::input_range<attribute_view>); |
| 138 | 138 | ||
| 139 | template <class T> | 139 | template <typename T> |
| 140 | class promise; | 140 | class promise; |
| 141 | 141 | ||
| 142 | template <class T> | 142 | template <typename T> |
| 143 | struct [[clang::coro_await_elidable, clang::coro_return_type]] parser | 143 | struct [[clang::coro_await_elidable, clang::coro_return_type]] parser |
| 144 | { | 144 | { |
| 145 | using promise_type = promise<T>; | 145 | using promise_type = promise<T>; |
| @@ -204,7 +204,7 @@ using event = std::variant< | |||
| 204 | processing_instructions_event, xml_decl_event, eof_event | 204 | processing_instructions_event, xml_decl_event, eof_event |
| 205 | >; | 205 | >; |
| 206 | 206 | ||
| 207 | template <class T> | 207 | template <typename T> |
| 208 | concept event_type = requires(event ev) { std::get<T>(ev); }; | 208 | concept event_type = requires(event ev) { std::get<T>(ev); }; |
| 209 | 209 | ||
| 210 | class executor; | 210 | class executor; |
| @@ -403,7 +403,7 @@ class executor | |||
| 403 | return std::exchange(ex_, nullptr); | 403 | return std::exchange(ex_, nullptr); |
| 404 | } | 404 | } |
| 405 | 405 | ||
| 406 | template <class T> | 406 | template <typename T> |
| 407 | friend class promise; | 407 | friend class promise; |
| 408 | 408 | ||
| 409 | public: | 409 | public: |
| @@ -453,7 +453,7 @@ public: | |||
| 453 | auto end() -> void; | 453 | auto end() -> void; |
| 454 | }; | 454 | }; |
| 455 | 455 | ||
| 456 | template <class T> | 456 | template <typename T> |
| 457 | class promise_returnable : public promise_base | 457 | class promise_returnable : public promise_base |
| 458 | { | 458 | { |
| 459 | std::optional<T> returned_value_; | 459 | std::optional<T> returned_value_; |
| @@ -462,7 +462,7 @@ public: | |||
| 462 | using result_type = T; | 462 | using result_type = T; |
| 463 | using promise_base::promise_base; | 463 | using promise_base::promise_base; |
| 464 | 464 | ||
| 465 | template <class U> | 465 | template <typename U> |
| 466 | auto return_value(U&& v) -> void | 466 | auto return_value(U&& v) -> void |
| 467 | { | 467 | { |
| 468 | returned_value_.emplace(std::forward<U>(v)); | 468 | returned_value_.emplace(std::forward<U>(v)); |
| @@ -486,13 +486,13 @@ public: | |||
| 486 | auto return_void() -> void {} | 486 | auto return_void() -> void {} |
| 487 | }; | 487 | }; |
| 488 | 488 | ||
| 489 | template <class T> | 489 | template <typename T> |
| 490 | class promise : public promise_returnable<T> | 490 | class promise : public promise_returnable<T> |
| 491 | { | 491 | { |
| 492 | public: | 492 | public: |
| 493 | // Called with all the coroutine's arguments. | 493 | // Called with all the coroutine's arguments. |
| 494 | // Ignoring all but the first argument, which should be the executor. | 494 | // Ignoring all but the first argument, which should be the executor. |
| 495 | template <class... Args> | 495 | template <typename... Args> |
| 496 | explicit promise(executor_ref executor, Args&&...) | 496 | explicit promise(executor_ref executor, Args&&...) |
| 497 | : promise_returnable<T>{executor} | 497 | : promise_returnable<T>{executor} |
| 498 | { | 498 | { |
| @@ -566,7 +566,7 @@ public: | |||
| 566 | return awaiter{req.executor}; | 566 | return awaiter{req.executor}; |
| 567 | } | 567 | } |
| 568 | 568 | ||
| 569 | template <class U> | 569 | template <typename U> |
| 570 | auto await_transform(parser<U> const& coro) | 570 | auto await_transform(parser<U> const& coro) |
| 571 | { | 571 | { |
| 572 | struct [[clang::coro_await_elidable]] awaiter | 572 | struct [[clang::coro_await_elidable]] awaiter |
| @@ -614,10 +614,10 @@ public: | |||
| 614 | // Helpers for handling XML documents. Non-polymorphic functions | 614 | // Helpers for handling XML documents. Non-polymorphic functions |
| 615 | // should be marked inline to allow HALO across TU boundaries. | 615 | // should be marked inline to allow HALO across TU boundaries. |
| 616 | 616 | ||
| 617 | template <class T> | 617 | template <typename T> |
| 618 | concept unconstrained = true; | 618 | concept unconstrained = true; |
| 619 | 619 | ||
| 620 | template <class T, template <class U> concept C> | 620 | template <typename T, template <typename U> concept C> |
| 621 | concept parser_of = requires { | 621 | concept parser_of = requires { |
| 622 | typename T::result_type; | 622 | typename T::result_type; |
| 623 | requires std::same_as<parser<typename T::result_type>, T>; | 623 | requires std::same_as<parser<typename T::result_type>, T>; |
| @@ -627,12 +627,12 @@ concept parser_of = requires { | |||
| 627 | template <parser_of<unconstrained> T> | 627 | template <parser_of<unconstrained> T> |
| 628 | using parser_result_t = T::result_type; | 628 | using parser_result_t = T::result_type; |
| 629 | 629 | ||
| 630 | template <class T, class... Args> | 630 | template <typename T, typename... Args> |
| 631 | concept parser_invocable = | 631 | concept parser_invocable = |
| 632 | std::invocable<T, Args...> | 632 | std::invocable<T, Args...> |
| 633 | && parser_of<std::invoke_result_t<T, Args...>, unconstrained>; | 633 | && parser_of<std::invoke_result_t<T, Args...>, unconstrained>; |
| 634 | 634 | ||
| 635 | template <class Fn, class... Args> | 635 | template <typename Fn, typename... Args> |
| 636 | requires parser_invocable<Fn, Args...> | 636 | requires parser_invocable<Fn, Args...> |
| 637 | using parser_invoke_result_t = | 637 | using parser_invoke_result_t = |
| 638 | parser_result_t<std::invoke_result_t<Fn, Args...>>; | 638 | parser_result_t<std::invoke_result_t<Fn, Args...>>; |
| @@ -833,7 +833,7 @@ inline auto read_string_contents(executor_ref e, attribute_view) | |||
| 833 | template <auto f> | 833 | template <auto f> |
| 834 | auto hohalo() | 834 | auto hohalo() |
| 835 | { | 835 | { |
| 836 | return []<class... Args>( | 836 | return []<typename... Args>( |
| 837 | Args&&... args) -> std::invoke_result_t<decltype(f), Args...> | 837 | Args&&... args) -> std::invoke_result_t<decltype(f), Args...> |
| 838 | { co_return co_await f(std::forward<Args>(args)...); }; | 838 | { co_return co_await f(std::forward<Args>(args)...); }; |
| 839 | } | 839 | } |