summaryrefslogtreecommitdiffhomepage
path: root/compat/format.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-18 23:42:07 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-18 23:42:07 +0100
commit4d9a82b720c8ce74b94f43f72ddd819ef21abbdf (patch)
treec0a5d21b8e19fbb60c286faec8e302e6f32b6679 /compat/format.hpp
parent32b8c22828315292857e2cd9909fba620f30ff70 (diff)
pre-declare integer types without cstddef/cstdint
Diffstat (limited to 'compat/format.hpp')
-rw-r--r--compat/format.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/compat/format.hpp b/compat/format.hpp
index bf6e8861..2a88abab 100644
--- a/compat/format.hpp
+++ b/compat/format.hpp
@@ -20,12 +20,12 @@ template<> struct formatter<Corrade::Containers::String> {
#if !FMT_USE_NONTYPE_TEMPLATE_ARGS
namespace floormat::detail::fmt {
-template<std::size_t N>
+template<size_t N>
struct fmt_string final {
- static constexpr std::size_t size = N;
+ static constexpr size_t size = N;
char data[N];
- template <std::size_t... Is>
+ template <size_t... Is>
consteval fmt_string(const char (&arr)[N]) noexcept {
for (auto i = 0_uz; i < N; i++)
data[i] = arr[i];
@@ -46,10 +46,10 @@ using namespace fmt::literals;
namespace floormat {
-template<std::size_t N, typename Fmt, typename... Xs>
-std::size_t snformat(char(&buf)[N], Fmt&& fmt, Xs&&... args)
+template<size_t N, typename Fmt, typename... Xs>
+size_t snformat(char(&buf)[N], Fmt&& fmt, Xs&&... args)
{
- constexpr std::size_t n = N > 0 ? N - 1 : 0;
+ constexpr size_t n = N > 0 ? N - 1 : 0;
auto result = fmt::format_to_n(buf, n, std::forward<Fmt>(fmt), std::forward<Xs>(args)...);
const auto len = std::min(n, result.size);
if constexpr(N > 0)