From: Wolfgang Bangerth Date: Tue, 21 Mar 2023 19:43:30 +0000 (-0600) Subject: Apply concepts to filtered_iterator.h. X-Git-Tag: v9.5.0-rc1~440^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14935%2Fhead;p=dealii.git Apply concepts to filtered_iterator.h. --- diff --git a/include/deal.II/grid/filtered_iterator.h b/include/deal.II/grid/filtered_iterator.h index a7815dd186..8180f87289 100644 --- a/include/deal.II/grid/filtered_iterator.h +++ b/include/deal.II/grid/filtered_iterator.h @@ -28,6 +28,11 @@ #include #include +#ifdef DEAL_II_HAVE_CXX20 +# include +#endif + + DEAL_II_NAMESPACE_OPEN @@ -638,6 +643,7 @@ public: * predicate for filtering subsequent assignment and iteration. */ template + DEAL_II_CXX20_REQUIRES((std::predicate)) FilteredIterator(Predicate p); /** @@ -658,6 +664,7 @@ public: * advanced to the first cell that has. */ template + DEAL_II_CXX20_REQUIRES((std::predicate)) FilteredIterator(Predicate p, const BaseIterator &bi); /** @@ -888,8 +895,9 @@ private: * @relatesalso FilteredIterator */ template -FilteredIterator -make_filtered_iterator(const BaseIterator &i, const Predicate &p) +DEAL_II_CXX20_REQUIRES((std::predicate)) +FilteredIterator make_filtered_iterator(const BaseIterator &i, + const Predicate & p) { FilteredIterator fi(p); fi.set_to_next_positive(i); @@ -978,8 +986,10 @@ namespace internal * @ingroup CPP11 */ template -inline IteratorRange> -filter_iterators(IteratorRange i, const Predicate &p) +DEAL_II_CXX20_REQUIRES((std::predicate)) +inline IteratorRange> filter_iterators( + IteratorRange i, + const Predicate & p) { FilteredIterator fi(p, *(i.begin())); FilteredIterator fi_end(p, *(i.end())); @@ -1045,12 +1055,13 @@ filter_iterators(IteratorRange i, const Predicate &p) * @ingroup CPP11 */ template +DEAL_II_CXX20_REQUIRES((std::predicate)) IteratorRange< typename internal::FilteredIteratorImplementation:: - NestFilteredIterators>::type> -filter_iterators(IteratorRange i, - const Predicate & p, - const Targs... args) + NestFilteredIterators>:: + type> filter_iterators(IteratorRange i, + const Predicate & p, + const Targs... args) { // Recursively create filtered iterators, one predicate at a time auto fi = filter_iterators(i, p); @@ -1118,6 +1129,7 @@ filter_iterators(IteratorRange i, * @ingroup CPP11 */ template +DEAL_II_CXX20_REQUIRES((std::predicate)) inline IteratorRange> operator|(IteratorRange i, const Predicate &p) { @@ -1131,6 +1143,7 @@ operator|(IteratorRange i, const Predicate &p) template template +DEAL_II_CXX20_REQUIRES((std::predicate)) inline FilteredIterator::FilteredIterator(Predicate p) : predicate(new PredicateTemplate(p)) {} @@ -1139,6 +1152,7 @@ inline FilteredIterator::FilteredIterator(Predicate p) template template +DEAL_II_CXX20_REQUIRES((std::predicate)) inline FilteredIterator::FilteredIterator(Predicate p, const BaseIterator &bi) : BaseIterator(bi)