Add Adder Helpers for HTTPHandlerBase
This commit is contained in:
parent
739ff6296a
commit
2f222e1eeb
1 changed files with 13 additions and 1 deletions
|
@ -43,7 +43,19 @@ struct HTTPHandlerBase {
|
|||
co_await stream.Close();
|
||||
};
|
||||
inline constexpr HTTPHandlerBase(auto, auto&) {};
|
||||
|
||||
};
|
||||
template <typename T>
|
||||
struct HTTPHandlerAdder {
|
||||
template <utempl::ConstexprString Name, Options Options>
|
||||
static consteval auto Adder(const auto& context) {
|
||||
return HTTPHandlerBase::template Adder<T, Name, Options>(context);
|
||||
};
|
||||
};
|
||||
template <typename T>
|
||||
struct HTTPHandlerBaseWithAdder : HTTPHandlerBase, HTTPHandlerAdder<T> {
|
||||
inline constexpr HTTPHandlerBaseWithAdder(auto name, auto& context) :
|
||||
HTTPHandlerBase(name, context),
|
||||
HTTPHandlerAdder<T>{} {};
|
||||
};
|
||||
|
||||
} // namespace cserver::server::handlers
|
||||
|
|
Loading…
Reference in a new issue