diff --git a/ostd/limits.hh b/ostd/limits.hh index f11481b..cdf148f 100644 --- a/ostd/limits.hh +++ b/ostd/limits.hh @@ -84,19 +84,19 @@ namespace detail { } template -static constexpr T NumericLimitMin = detail::NumericLimitsBase::minv; +constexpr T NumericLimitMin = detail::NumericLimitsBase::minv; template -static constexpr T NumericLimitMax = detail::NumericLimitsBase::maxv; +constexpr T NumericLimitMax = detail::NumericLimitsBase::maxv; template -static constexpr T NumericLimitLowest = detail::NumericLimitsBase::lowv; +constexpr T NumericLimitLowest = detail::NumericLimitsBase::lowv; template -static constexpr bool NumericLimitIsSigned = detail::NumericLimitsBase::is_signed; +constexpr bool NumericLimitIsSigned = detail::NumericLimitsBase::is_signed; template -static constexpr bool NumericLimitIsInteger = detail::NumericLimitsBase::is_integer; +constexpr bool NumericLimitIsInteger = detail::NumericLimitsBase::is_integer; } diff --git a/ostd/type_traits.hh b/ostd/type_traits.hh index 34d135c..4623b8a 100644 --- a/ostd/type_traits.hh +++ b/ostd/type_traits.hh @@ -7,6 +7,7 @@ #ifndef OSTD_TYPE_TRAITS_HH #define OSTD_TYPE_TRAITS_HH +#include #include #include "ostd/types.hh" @@ -55,6 +56,11 @@ namespace detail { AddRvalueReference declval_in() noexcept; } +/* size in bits */ + +template +constexpr Size SizeInBits = sizeof(T) * CHAR_BIT; + /* integral constant */ template