[PATCH] llvm::all_of

David Blaikie dblaikie at gmail.com
Wed May 13 14:54:16 PDT 2015


Drop the static inline (the static part would cause ODR violations in other
inline functions in headers that call this function, the inline part is
mostly redundant because it just changes the linkage which implicit
template specializations already have anyway)

Wonder if there's a way to get these down to one implementation...

template<typename Range, class UnaryPredicate>
bool all_of(Range &&R, UnaryPredicate &&P) {
  return std::all_of(R.begin(), R.end(), std::forward<UnaryPredicate>(P));
}

Maybe?

On Wed, May 13, 2015 at 2:41 PM, Pete Cooper <peter_cooper at apple.com> wrote:

> Hey David
>
> (For the benefit of mailing archives, this is a spin-off from a discussion
> on
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150511/276283.html
> )
>
> This is the patch we discussed to add an llvm version of std::all_of which
> doesn’t need begin/end.  Also added a user of it to LoopInfo which was the
> motivating example you pointed out.
>
> Comments welcome.
>
> Cheers,
> Pete
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150513/6bbae05e/attachment.html>


More information about the llvm-commits mailing list