diff --git a/integral_limits.h b/integral_limits.h index 27ced882..aea8521c 100644 --- a/integral_limits.h +++ b/integral_limits.h @@ -40,7 +40,7 @@ SOFTWARE. //***************************************************************************** ///\defgroup integral_limits integral_limits -/// A set of templated compile time constants. +/// A set of templated compile time constants that mirror some of std::numeric_limits funtionality. ///\ingroup utilities //***************************************************************************** @@ -48,11 +48,25 @@ namespace etl { //*************************************************************************** ///\ingroup integral_limits + //*************************************************************************** template struct integral_limits; //*************************************************************************** ///\ingroup integral_limits + //*************************************************************************** + template <> + struct integral_limits + { + static const int min = 0; + static const int max = 0; + static const int bits = 0; + static const bool is_signed = false; + }; + + //*************************************************************************** + ///\ingroup integral_limits + //*************************************************************************** template <> struct integral_limits { @@ -64,6 +78,7 @@ namespace etl //*************************************************************************** ///\ingroup integral_limits + //*************************************************************************** template <> struct integral_limits { @@ -75,9 +90,10 @@ namespace etl //*************************************************************************** ///\ingroup integral_limits + //*************************************************************************** template <> struct integral_limits - { + { static const char min = (etl::is_signed::value) ? SCHAR_MIN : 0; static const char max = (etl::is_signed::value) ? SCHAR_MAX : UCHAR_MAX; static const int bits = CHAR_BIT; @@ -86,6 +102,7 @@ namespace etl //*************************************************************************** ///\ingroup integral_limits + //*************************************************************************** template <> struct integral_limits { @@ -97,6 +114,7 @@ namespace etl //*************************************************************************** ///\ingroup integral_limits + //*************************************************************************** template <> struct integral_limits { @@ -108,6 +126,7 @@ namespace etl //*************************************************************************** ///\ingroup integral_limits + //*************************************************************************** template <> struct integral_limits { @@ -119,6 +138,7 @@ namespace etl //*************************************************************************** ///\ingroup integral_limits + //*************************************************************************** template <> struct integral_limits { @@ -130,6 +150,7 @@ namespace etl //*************************************************************************** ///\ingroup integral_limits + //*************************************************************************** template <> struct integral_limits { @@ -141,6 +162,7 @@ namespace etl //*************************************************************************** ///\ingroup integral_limits + //*************************************************************************** template <> struct integral_limits { @@ -152,6 +174,7 @@ namespace etl //*************************************************************************** ///\ingroup integral_limits + //*************************************************************************** template <> struct integral_limits { @@ -163,6 +186,7 @@ namespace etl //*************************************************************************** ///\ingroup integral_limits + //*************************************************************************** template <> struct integral_limits {