mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-04 20:54:28 +02:00
use assert. static can't work
This commit is contained in:
committed by
Mateusz Pusz
parent
065323c7d7
commit
d4492524d1
@@ -24,13 +24,13 @@
|
||||
|
||||
#include <units/concepts.h>
|
||||
#include <units/bits/dimension_op.h>
|
||||
#include <cassert>
|
||||
|
||||
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) {
|
||||
|
Reference in New Issue
Block a user