We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23deda3 commit f5289a1Copy full SHA for f5289a1
libcxx/include/__iterator/prev.h
@@ -39,6 +39,9 @@ prev(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n)
39
return __x;
40
}
41
42
+// LWG 3197
43
+// It is unclear what the implications of "BidirectionalIterator" in the standard are.
44
+// However, calling std::prev(non-bidi-iterator) is obviously an error and we should catch it at compile time.
45
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
46
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 _InputIter prev(_InputIter __it) {
47
static_assert(__has_bidirectional_iterator_category<_InputIter>::value,
0 commit comments