forked from mpusz/mp-units
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/concepts.h>
|
||||||
#include <units/bits/dimension_op.h>
|
#include <units/bits/dimension_op.h>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
namespace units {
|
namespace units {
|
||||||
|
|
||||||
constexpr std::intmax_t ipow10(std::intmax_t exp)
|
constexpr std::intmax_t ipow10(std::intmax_t exp)
|
||||||
{
|
{
|
||||||
// how to assert here?
|
assert(exp >= 0);
|
||||||
// static_assert(exp >= 0, "Use fpow10() for negative exponents");
|
|
||||||
if (exp == 0) return 1;
|
if (exp == 0) return 1;
|
||||||
std::intmax_t result = 1;
|
std::intmax_t result = 1;
|
||||||
while (exp > 0) {
|
while (exp > 0) {
|
||||||
|
Reference in New Issue
Block a user