diff --git a/include/stdx/detail/fmt.hpp b/include/stdx/detail/fmt.hpp index fd6172a..73c833f 100644 --- a/include/stdx/detail/fmt.hpp +++ b/include/stdx/detail/fmt.hpp @@ -77,7 +77,7 @@ CONSTEVAL auto formatted_size(fmt_spec s, I i) -> std::size_t { while (i != 0) { ++sz; - i /= s.base; + i /= static_cast(s.base); } return sz; } @@ -131,8 +131,8 @@ CONSTEVAL auto format_to(fmt_spec s, It dest, I i) -> It { auto b = dest; while (i != 0) { - auto digit = to_digit(abs(i % s.base)); - i /= s.base; + auto digit = to_digit(abs(i % static_cast(s.base))); + i /= static_cast(s.base); *dest++ = digit; } diff --git a/include/stdx/iterator.hpp b/include/stdx/iterator.hpp index fda8c56..e315343 100644 --- a/include/stdx/iterator.hpp +++ b/include/stdx/iterator.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include #include @@ -25,7 +26,8 @@ constexpr auto ct_capacity_v> = N; template constexpr auto ct_capacity_v = ct_capacity_v; -template constexpr auto ct_capacity(T &&) -> std::size_t { +template +CONSTEVAL auto ct_capacity([[maybe_unused]] T &&) -> std::size_t { return ct_capacity_v>; } diff --git a/test/ct_format.cpp b/test/ct_format.cpp index 5876da8..2808225 100644 --- a/test/ct_format.cpp +++ b/test/ct_format.cpp @@ -333,7 +333,7 @@ TEST_CASE("FORMAT a constexpr string_view argument", "[ct_format]") { } TEST_CASE("FORMAT an integral_constant argument", "[ct_format]") { - auto I = std::integral_constant{}; + auto I = std::integral_constant{}; STATIC_REQUIRE(STDX_CT_FORMAT("Hello {}", I) == "Hello 17"_fmt_res); }