From 86be7938f14702bc4ca5cd51d12419210777e5a4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 8 Jun 2022 21:03:44 +0200 Subject: [PATCH] util/SpanCast: swap the CopyConst template parameters --- src/util/SpanCast.hxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/SpanCast.hxx b/src/util/SpanCast.hxx index 3aec5dfa4..e5b927cd5 100644 --- a/src/util/SpanCast.hxx +++ b/src/util/SpanCast.hxx @@ -34,7 +34,7 @@ #include #include -template +template using CopyConst = std::conditional_t, const To, To>; /** @@ -43,7 +43,7 @@ using CopyConst = std::conditional_t, const To, To>; */ template constexpr std::span -FromBytesFloor(std::span> other) noexcept +FromBytesFloor(std::span> other) noexcept { static_assert(sizeof(T) > 0, "Empty base type"); @@ -51,7 +51,7 @@ FromBytesFloor(std::span> other) noexcept warnings, but should we really suppress them? */ return { - reinterpret_cast(reinterpret_cast *>(other.data())), + reinterpret_cast(reinterpret_cast *>(other.data())), other.size() / sizeof(T), }; } @@ -61,7 +61,7 @@ FromBytesFloor(std::span> other) noexcept */ template constexpr std::span -FromBytesStrict(std::span> other) noexcept +FromBytesStrict(std::span> other) noexcept { assert(other.size() % sizeof(T) == 0);