From 056f15e3c58c1dc471a95b4ec714cc7cd81cbeb0 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 15 Jan 2018 19:40:34 +0000 Subject: More constexpr from P0202. count and count_if. Also fix a comment that Morwenn noted. llvm-svn: 322506 --- libcxx/include/algorithm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libcxx/include/algorithm') diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index ee06250f467..44a3d107b84 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -79,11 +79,11 @@ template adjacent_find(ForwardIterator first, ForwardIterator last, BinaryPredicate pred); template - typename iterator_traits::difference_type + constexpr typename iterator_traits::difference_type // constexpr in C++20 count(InputIterator first, InputIterator last, const T& value); template - typename iterator_traits::difference_type + constexpr typename iterator_traits::difference_type // constexpr in C++20 count_if(InputIterator first, InputIterator last, Predicate pred); template @@ -333,11 +333,11 @@ template is_sorted(ForwardIterator first, ForwardIterator last, Compare comp); template - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 is_sorted_until(ForwardIterator first, ForwardIterator last); template - ForwardIterator + constexpr ForwardIterator // constexpr in C++20 is_sorted_until(ForwardIterator first, ForwardIterator last, Compare comp); template @@ -1240,7 +1240,7 @@ adjacent_find(_ForwardIterator __first, _ForwardIterator __last) // count template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename iterator_traits<_InputIterator>::difference_type count(_InputIterator __first, _InputIterator __last, const _Tp& __value_) { @@ -1254,7 +1254,7 @@ count(_InputIterator __first, _InputIterator __last, const _Tp& __value_) // count_if template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename iterator_traits<_InputIterator>::difference_type count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred) { -- cgit v1.2.3