Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
huixie90 committed Oct 13, 2024
1 parent 6cd8e5c commit 0ab15ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions libcxx/include/__iterator/prev.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
# pragma GCC system_header
#endif

_LIBCPP_PUSH_MACROS
#include <__undef_macros>

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
Expand Down Expand Up @@ -78,4 +81,6 @@ inline constexpr auto prev = __prev{};

_LIBCPP_END_NAMESPACE_STD

_LIBCPP_POP_MACROS

#endif // _LIBCPP___ITERATOR_PREV_H
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ template <class Iter>
std::false_type prev_test(...);

template <class Iter>
decltype((void) std::prev(std::declval<Iter>()), std::true_type()) prev_test(int);
decltype((void)std::prev(std::declval<Iter>()), std::true_type()) prev_test(int);

template <class Iter>
using CanPrev = decltype(prev_test<Iter>(0));

static_assert(!CanPrev<cpp17_input_iterator<int*> >::value, "");
static_assert(CanPrev<bidirectional_iterator<int*> >::value, "");
#if TEST_STD_VER >= 20
static_assert(!CanPrev<cpp20_random_access_iterator<int*> >::value);
static_assert(!CanPrev<cpp20_random_access_iterator<int*> >::value);
#endif

template <class It>
Expand Down

0 comments on commit 0ab15ce

Please sign in to comment.