Base 36 should also be unsigned
This commit is contained in:
parent
1b73bd49fa
commit
8419c47a70
1 changed files with 1 additions and 1 deletions
|
@ -42,7 +42,7 @@ namespace dhandy {
|
||||||
template <typename I, unsigned int Base>
|
template <typename I, unsigned int Base>
|
||||||
struct int_info {
|
struct int_info {
|
||||||
static_assert(Base > 1, "Invalid base");
|
static_assert(Base > 1, "Invalid base");
|
||||||
static const constexpr bool always_unsigned = (Base == 16 or Base == 2);
|
static const constexpr bool always_unsigned = (Base == 16 or Base == 2 or Base == 36);
|
||||||
static const constexpr bool is_signed = std::numeric_limits<I>::is_signed and not always_unsigned;
|
static const constexpr bool is_signed = std::numeric_limits<I>::is_signed and not always_unsigned;
|
||||||
static const constexpr std::size_t max_len = max_digit_count<typename std::conditional<always_unsigned, std::make_unsigned_t<I>, I>::type, Base> + is_signed;
|
static const constexpr std::size_t max_len = max_digit_count<typename std::conditional<always_unsigned, std::make_unsigned_t<I>, I>::type, Base> + is_signed;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue