diff --git a/include/fastgltf/util.hpp b/include/fastgltf/util.hpp index cf369a3ec..4eb23c6e6 100644 --- a/include/fastgltf/util.hpp +++ b/include/fastgltf/util.hpp @@ -274,7 +274,7 @@ namespace fastgltf { #if FASTGLTF_HAS_CONCEPTS requires std::integral #endif - [[gnu::const]] std::uint8_t clz(T value) { + [[gnu::const]] constexpr std::uint8_t clz(T value) { static_assert(std::is_integral_v); #if FASTGLTF_HAS_BIT return static_cast(std::countl_zero(value)); @@ -294,7 +294,7 @@ namespace fastgltf { } template - [[gnu::const]] std::uint8_t popcount(T value) { + [[gnu::const]] constexpr std::uint8_t popcount(T value) { static_assert(std::is_integral_v); #if FASTGLTF_HAS_BIT return static_cast(std::popcount(value));