summaryrefslogtreecommitdiffstats
path: root/server/src/util.cppm
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/util.cppm')
-rw-r--r--server/src/util.cppm14
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;
7namespace routemon::util { 7namespace 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).
10template <class... Ts> 10template <typename... Ts>
11struct overloaded : Ts... 11struct 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
51template <class T> 51template <typename T>
52class aolist : public std::enable_shared_from_this<aolist<T>> 52class 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
180template <class T> 180template <typename T>
181class not_null; 181class not_null;
182 182
183template <class T> 183template <typename T>
184class not_null<T*> 184class 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};
223template <class T> 223template <typename T>
224explicit not_null(T*) -> not_null<T*>; 224explicit not_null(T*) -> not_null<T*>;
225 225
226template <> 226template <>
@@ -248,7 +248,7 @@ explicit not_null(lazy_zstring_view s) -> not_null<lazy_zstring_view>;
248template <> 248template <>
249struct std::formatter<routemon::util::zstring_view, char> 249struct 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 {