[PATCH] llvm::all_of

David Blaikie dblaikie at gmail.com
Wed May 13 15:18:01 PDT 2015


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

> It compiled fine.  Running ‘make check-all’ now.  If it passes with this
> single version then are you ok with me committing?
>

Yep, let's go with that. I feel better about it so we're not committing
completely dead/untested code.


>
> template<typename R, class UnaryPredicate>
> bool all_of(R &&Range, UnaryPredicate &&P) {
>   return std::all_of(Range.begin(), Range.end(),
>                      std::forward<UnaryPredicate>(P));
> }
>
> Cheers,
> Pete
>
> On May 13, 2015, at 2:54 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
> 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/1e3611ad/attachment.html>


More information about the llvm-commits mailing list