userver: userver/utils/fmt_compat.hpp Source File
Loading...
Searching...
No Matches
fmt_compat.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/utils/fmt_compat.hpp
4/// @brief Compatibility shims for different {fmt} library versions.
5/// @ingroup userver_universal
6
7#include <fmt/core.h>
8
9#if FMT_VERSION < 80000
10#define USERVER_FMT_CONST
11
12/// @brief `{fmt}` compatibility shims across supported versions.
13namespace fmt {
14
15template <typename S>
16const S& runtime(const S& s) {
17 return s;
18}
19
20} // namespace fmt
21#else
22#define USERVER_FMT_CONST const
23#endif