summaryrefslogtreecommitdiffstats
path: root/libcxx/include/algorithm
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2018-01-16 15:48:27 +0000
committerMarshall Clow <mclow.lists@gmail.com>2018-01-16 15:48:27 +0000
commit12f0a77902fb71b7a7095551450f8bd494aaff68 (patch)
tree2949a47fa956cdc1148c5ff684d5bafb94dc769f /libcxx/include/algorithm
parente1d2d22d2a1c329d269b13e2d43c97fd5e8838aa (diff)
downloadbcm5719-llvm-12f0a77902fb71b7a7095551450f8bd494aaff68.tar.gz
bcm5719-llvm-12f0a77902fb71b7a7095551450f8bd494aaff68.zip
More constexpr algorithms from P0202. search/search_n
llvm-svn: 322566
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r--libcxx/include/algorithm22
1 files changed, 11 insertions, 11 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index da0cc81f971..4672810a21a 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -148,21 +148,21 @@ template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
BinaryPredicate pred); // **C++14**
template <class ForwardIterator1, class ForwardIterator2>
- ForwardIterator1
+ constexpr ForwardIterator1 // constexpr in C++20
search(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2);
template <class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
- ForwardIterator1
+ constexpr ForwardIterator1 // constexpr in C++20
search(ForwardIterator1 first1, ForwardIterator1 last1,
ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred);
template <class ForwardIterator, class Size, class T>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value);
template <class ForwardIterator, class Size, class T, class BinaryPredicate>
- ForwardIterator
+ constexpr ForwardIterator // constexpr in C++20
search_n(ForwardIterator first, ForwardIterator last,
Size count, const T& value, BinaryPredicate pred);
@@ -1544,7 +1544,7 @@ is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
// __search is in <functional>
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator1
search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
@@ -1557,7 +1557,7 @@ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
}
template <class _ForwardIterator1, class _ForwardIterator2>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator1
search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2)
@@ -1570,7 +1570,7 @@ search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
#if _LIBCPP_STD_VER > 14
template <class _ForwardIterator, class _Searcher>
-_LIBCPP_INLINE_VISIBILITY
+_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s)
{ return __s(__f, __l).first; }
#endif
@@ -1578,7 +1578,7 @@ _ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searc
// search_n
template <class _BinaryPredicate, class _ForwardIterator, class _Size, class _Tp>
-_ForwardIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
__search_n(_ForwardIterator __first, _ForwardIterator __last,
_Size __count, const _Tp& __value_, _BinaryPredicate __pred, forward_iterator_tag)
{
@@ -1615,7 +1615,7 @@ __search_n(_ForwardIterator __first, _ForwardIterator __last,
}
template <class _BinaryPredicate, class _RandomAccessIterator, class _Size, class _Tp>
-_RandomAccessIterator
+_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator
__search_n(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Size __count, const _Tp& __value_, _BinaryPredicate __pred, random_access_iterator_tag)
{
@@ -1655,7 +1655,7 @@ __search_n(_RandomAccessIterator __first, _RandomAccessIterator __last,
}
template <class _ForwardIterator, class _Size, class _Tp, class _BinaryPredicate>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator
search_n(_ForwardIterator __first, _ForwardIterator __last,
_Size __count, const _Tp& __value_, _BinaryPredicate __pred)
@@ -1666,7 +1666,7 @@ search_n(_ForwardIterator __first, _ForwardIterator __last,
}
template <class _ForwardIterator, class _Size, class _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
_ForwardIterator
search_n(_ForwardIterator __first, _ForwardIterator __last, _Size __count, const _Tp& __value_)
{
OpenPOWER on IntegriCloud