]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/ext/numeric_traits.h
libstdc++: Replace __int_limits with __numeric_traits_integer
[thirdparty/gcc.git] / libstdc++-v3 / include / ext / numeric_traits.h
index 4c74d7ea092e0ab107874aa0075e6b80f0a5c144..69f286d7be7c2c15df6049d70010977ad7869d00 100644 (file)
@@ -54,6 +54,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Value>
     struct __numeric_traits_integer
     {
+#if __cplusplus >= 201103L
+      static_assert(std::__is_integer<_Value>::__value,
+                   "invalid specialization");
+#endif
+
       // Only integers for initialization of member constant.
       static const _Value __min = __glibcxx_min(_Value);
       static const _Value __max = __glibcxx_max(_Value);
@@ -76,6 +81,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Value>
     const int __numeric_traits_integer<_Value>::__digits;
 
+#if __cplusplus >= 201103L
+  template<typename _Tp>
+    using __int_traits = __numeric_traits_integer<_Tp>;
+#endif
+
 #undef __glibcxx_signed
 #undef __glibcxx_digits
 #undef __glibcxx_min