From d4492524d1a5db146f82d578227634178211a27e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Sch=C3=B6nrock?= Date: Sun, 23 Feb 2020 15:36:07 +0000 Subject: [PATCH] use assert. static can't work --- src/include/units/quantity_cast.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/units/quantity_cast.h b/src/include/units/quantity_cast.h index 7c213780..d88c278a 100644 --- a/src/include/units/quantity_cast.h +++ b/src/include/units/quantity_cast.h @@ -24,13 +24,13 @@ #include #include +#include namespace units { constexpr std::intmax_t ipow10(std::intmax_t exp) { - // how to assert here? - // static_assert(exp >= 0, "Use fpow10() for negative exponents"); + assert(exp >= 0); if (exp == 0) return 1; std::intmax_t result = 1; while (exp > 0) {