2019-10-06 François Dumont <fdumont@gcc.gnu.org>
+ * include/bits/stl_iterator_base_types.h (__iterator_category_t): Define
+ for C++11.
+ (_RequireInputIte): Likewise and use __enable_if_t.
+ * include/std/numeric
+ (__is_random_access_iter): Use __iterator_category_t.
+
* include/bits/stl_algo.h (copy_n): Add __glibcxx_requires_can_increment
debug checks.
* testsuite/25_algorithms/copy_n/debug/1_neg.cc: New.
//@}
#if __cplusplus >= 201103L
+ template<typename _Iter>
+ using __iterator_category_t
+ = typename iterator_traits<_Iter>::iterator_category;
+
template<typename _InIter>
- using _RequireInputIter = typename
- enable_if<is_convertible<typename
- iterator_traits<_InIter>::iterator_category,
- input_iterator_tag>::value>::type;
+ using _RequireInputIter =
+ __enable_if_t<is_convertible<__iterator_category_t<_InIter>,
+ input_iterator_tag>::value>;
#endif
_GLIBCXX_END_NAMESPACE_VERSION
/// @{
/// @cond undocumented
- template<typename _It, typename _Traits = iterator_traits<_It>,
- typename _Cat = typename _Traits::iterator_category>
+ template<typename _It, typename _Cat = __iterator_category_t<_It>>
using __is_random_access_iter
= is_base_of<random_access_iterator_tag, _Cat>;
/// @endcond