26 #ifndef NFD_CORE_ALGORITHM_HPP 27 #define NFD_CORE_ALGORITHM_HPP 30 #include <boost/concept/requires.hpp> 43 template<
typename It,
typename Pred>
44 BOOST_CONCEPT_REQUIRES(
45 ((boost::BidirectionalIterator<It>))
46 ((boost::UnaryPredicate<Pred,
typename std::iterator_traits<It>::value_type>)),
51 std::reverse_iterator<It> firstR(first), lastR(last);
52 auto found = std::find_if(lastR, firstR, p);
53 return found == firstR ? last : std::prev(found.base());
58 #endif // NFD_CORE_ALGORITHM_HPP It find_last_if(It first, It last, Pred p)
finds the last element satisfying a predicate
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...