#include <set>
#include <tuple>
+#ifdef DEAL_II_HAVE_CXX20
+# include <concepts>
+#endif
+
+
DEAL_II_NAMESPACE_OPEN
* predicate for filtering subsequent assignment and iteration.
*/
template <typename Predicate>
+ DEAL_II_CXX20_REQUIRES((std::predicate<Predicate, BaseIterator>))
FilteredIterator(Predicate p);
/**
* advanced to the first cell that has.
*/
template <typename Predicate>
+ DEAL_II_CXX20_REQUIRES((std::predicate<Predicate, BaseIterator>))
FilteredIterator(Predicate p, const BaseIterator &bi);
/**
* @relatesalso FilteredIterator
*/
template <typename BaseIterator, typename Predicate>
-FilteredIterator<BaseIterator>
-make_filtered_iterator(const BaseIterator &i, const Predicate &p)
+DEAL_II_CXX20_REQUIRES((std::predicate<Predicate, BaseIterator>))
+FilteredIterator<BaseIterator> make_filtered_iterator(const BaseIterator &i,
+ const Predicate & p)
{
FilteredIterator<BaseIterator> fi(p);
fi.set_to_next_positive(i);
* @ingroup CPP11
*/
template <typename BaseIterator, typename Predicate>
-inline IteratorRange<FilteredIterator<BaseIterator>>
-filter_iterators(IteratorRange<BaseIterator> i, const Predicate &p)
+DEAL_II_CXX20_REQUIRES((std::predicate<Predicate, BaseIterator>))
+inline IteratorRange<FilteredIterator<BaseIterator>> filter_iterators(
+ IteratorRange<BaseIterator> i,
+ const Predicate & p)
{
FilteredIterator<BaseIterator> fi(p, *(i.begin()));
FilteredIterator<BaseIterator> fi_end(p, *(i.end()));
* @ingroup CPP11
*/
template <typename BaseIterator, typename Predicate, typename... Targs>
+DEAL_II_CXX20_REQUIRES((std::predicate<Predicate, BaseIterator>))
IteratorRange<
typename internal::FilteredIteratorImplementation::
- NestFilteredIterators<BaseIterator, std::tuple<Predicate, Targs...>>::type>
-filter_iterators(IteratorRange<BaseIterator> i,
- const Predicate & p,
- const Targs... args)
+ NestFilteredIterators<BaseIterator, std::tuple<Predicate, Targs...>>::
+ type> filter_iterators(IteratorRange<BaseIterator> i,
+ const Predicate & p,
+ const Targs... args)
{
// Recursively create filtered iterators, one predicate at a time
auto fi = filter_iterators(i, p);
* @ingroup CPP11
*/
template <typename BaseIterator, typename Predicate>
+DEAL_II_CXX20_REQUIRES((std::predicate<Predicate, BaseIterator>))
inline IteratorRange<FilteredIterator<BaseIterator>>
operator|(IteratorRange<BaseIterator> i, const Predicate &p)
{
template <typename BaseIterator>
template <typename Predicate>
+DEAL_II_CXX20_REQUIRES((std::predicate<Predicate, BaseIterator>))
inline FilteredIterator<BaseIterator>::FilteredIterator(Predicate p)
: predicate(new PredicateTemplate<Predicate>(p))
{}
template <typename BaseIterator>
template <typename Predicate>
+DEAL_II_CXX20_REQUIRES((std::predicate<Predicate, BaseIterator>))
inline FilteredIterator<BaseIterator>::FilteredIterator(Predicate p,
const BaseIterator &bi)
: BaseIterator(bi)