Another batch of P0202 constepr algirithms. remove/remove_if/remove_copy/remove_copy_if/reverse_copy, and tests (commented out) for rotate_copy, because that depends on std::copy
llvm-svn: 323152
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index c00845f..3dda30d 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -236,19 +236,19 @@
generate_n(OutputIterator first, Size n, Generator gen);
template <class ForwardIterator, class T>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
remove(ForwardIterator first, ForwardIterator last, const T& value);
template <class ForwardIterator, class Predicate>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
remove_if(ForwardIterator first, ForwardIterator last, Predicate pred);
template <class InputIterator, class OutputIterator, class T>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
remove_copy(InputIterator first, InputIterator last, OutputIterator result, const T& value);
template <class InputIterator, class OutputIterator, class Predicate>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred);
template <class ForwardIterator>
@@ -272,7 +272,7 @@
reverse(BidirectionalIterator first, BidirectionalIterator last);
template <class BidirectionalIterator, class OutputIterator>
- OutputIterator
+ constexpr OutputIterator // constexpr in C++20
reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result);
template <class ForwardIterator>
@@ -2098,7 +2098,7 @@
// remove
template <class _ForwardIterator, class _Tp>
-_ForwardIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
{
__first = _VSTD::find(__first, __last, __value_);
@@ -2120,7 +2120,7 @@
// remove_if
template <class _ForwardIterator, class _Predicate>
-_ForwardIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
{
__first = _VSTD::find_if<_ForwardIterator, typename add_lvalue_reference<_Predicate>::type>
@@ -2143,7 +2143,7 @@
// remove_copy
template <class _InputIterator, class _OutputIterator, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
remove_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, const _Tp& __value_)
{
@@ -2161,7 +2161,7 @@
// remove_copy_if
template <class _InputIterator, class _OutputIterator, class _Predicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
remove_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred)
{
@@ -2327,7 +2327,7 @@
// reverse_copy
template <class _BidirectionalIterator, class _OutputIterator>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_OutputIterator
reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
{