aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/include/std')
-rw-r--r--libstdc++-v3/include/std/regex1
-rw-r--r--libstdc++-v3/include/std/string_view9
2 files changed, 6 insertions, 4 deletions
diff --git a/libstdc++-v3/include/std/regex b/libstdc++-v3/include/std/regex
index b4b8ea7..43ee1ae 100644
--- a/libstdc++-v3/include/std/regex
+++ b/libstdc++-v3/include/std/regex
@@ -53,6 +53,7 @@
#include <cstring>
#include <ext/aligned_buffer.h>
+#include <ext/numeric_traits.h>
#include <bits/std_function.h>
#include <bits/regex_constants.h>
#include <bits/regex_error.h>
diff --git a/libstdc++-v3/include/std/string_view b/libstdc++-v3/include/std/string_view
index 32c51b2..656d06b 100644
--- a/libstdc++-v3/include/std/string_view
+++ b/libstdc++-v3/include/std/string_view
@@ -459,11 +459,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static constexpr int
_S_compare(size_type __n1, size_type __n2) noexcept
{
+ using __limits = __gnu_cxx::__int_traits<int>;
const difference_type __diff = __n1 - __n2;
- if (__diff > __gnu_cxx::__int_traits<int>::__max)
- return __gnu_cxx::__int_traits<int>::__max;
- if (__diff < __gnu_cxx::__int_traits<int>::__min)
- return __gnu_cxx::__int_traits<int>::__min;
+ if (__diff > __limits::__max)
+ return __limits::__max;
+ if (__diff < __limits::__min)
+ return __limits::__min;
return static_cast<int>(__diff);
}