diff options
Diffstat (limited to 'server/src/util.cppm')
| -rw-r--r-- | server/src/util.cppm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/server/src/util.cppm b/server/src/util.cppm index 986e350..aedc120 100644 --- a/server/src/util.cppm +++ b/server/src/util.cppm | |||
| @@ -7,7 +7,7 @@ import std; | |||
| 7 | namespace routemon::util { | 7 | namespace routemon::util { |
| 8 | 8 | ||
| 9 | // For use with e.g. std::visit (on std::variant). | 9 | // For use with e.g. std::visit (on std::variant). |
| 10 | template <class... Ts> | 10 | template <typename... Ts> |
| 11 | struct overloaded : Ts... | 11 | struct overloaded : Ts... |
| 12 | { | 12 | { |
| 13 | using Ts::operator()...; | 13 | using Ts::operator()...; |
| @@ -48,7 +48,7 @@ constexpr auto parse_int(std::string_view s, int base = 10) noexcept | |||
| 48 | return x; | 48 | return x; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | template <class T> | 51 | template <typename T> |
| 52 | class aolist : public std::enable_shared_from_this<aolist<T>> | 52 | class aolist : public std::enable_shared_from_this<aolist<T>> |
| 53 | { | 53 | { |
| 54 | T v_; | 54 | T v_; |
| @@ -177,10 +177,10 @@ constexpr auto split_on(std::string_view s, char c) | |||
| 177 | return std::make_pair(s, std::nullopt); | 177 | return std::make_pair(s, std::nullopt); |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | template <class T> | 180 | template <typename T> |
| 181 | class not_null; | 181 | class not_null; |
| 182 | 182 | ||
| 183 | template <class T> | 183 | template <typename T> |
| 184 | class not_null<T*> | 184 | class not_null<T*> |
| 185 | { | 185 | { |
| 186 | T* p_; | 186 | T* p_; |
| @@ -220,7 +220,7 @@ public: | |||
| 220 | 220 | ||
| 221 | auto operator->() const noexcept -> T* { return p_; } | 221 | auto operator->() const noexcept -> T* { return p_; } |
| 222 | }; | 222 | }; |
| 223 | template <class T> | 223 | template <typename T> |
| 224 | explicit not_null(T*) -> not_null<T*>; | 224 | explicit not_null(T*) -> not_null<T*>; |
| 225 | 225 | ||
| 226 | template <> | 226 | template <> |
| @@ -248,7 +248,7 @@ explicit not_null(lazy_zstring_view s) -> not_null<lazy_zstring_view>; | |||
| 248 | template <> | 248 | template <> |
| 249 | struct std::formatter<routemon::util::zstring_view, char> | 249 | struct std::formatter<routemon::util::zstring_view, char> |
| 250 | { | 250 | { |
| 251 | template <class ParseContext> | 251 | template <typename ParseContext> |
| 252 | constexpr auto parse(ParseContext& ctx) -> ParseContext::iterator | 252 | constexpr auto parse(ParseContext& ctx) -> ParseContext::iterator |
| 253 | { | 253 | { |
| 254 | auto it = ctx.begin(); | 254 | auto it = ctx.begin(); |
| @@ -259,7 +259,7 @@ struct std::formatter<routemon::util::zstring_view, char> | |||
| 259 | return it; | 259 | return it; |
| 260 | } | 260 | } |
| 261 | 261 | ||
| 262 | template <class FmtContext> | 262 | template <typename FmtContext> |
| 263 | auto format(routemon::util::zstring_view s, FmtContext& ctx) const | 263 | auto format(routemon::util::zstring_view s, FmtContext& ctx) const |
| 264 | -> FmtContext::iterator | 264 | -> FmtContext::iterator |
| 265 | { | 265 | { |