diff --git a/include/upa/util.h b/include/upa/util.h index 92b2799..921ce48 100644 --- a/include/upa/util.h +++ b/include/upa/util.h @@ -51,7 +51,7 @@ template = b) { const UT diff = static_cast(static_cast(a) - static_cast(b)); if (diff <= unsigned_limit::max()) @@ -95,7 +95,7 @@ inline void unsigned_to_str(UIntT num, std::string& output, UIntT base) { // Append data to string -inline std::size_t add_sizes(std::size_t size1, std::size_t size2, std::size_t max_size) { +constexpr std::size_t add_sizes(std::size_t size1, std::size_t size2, std::size_t max_size) { if (max_size - size1 < size2) throw std::length_error("too big size"); // now it is safe to add sizes