[PATCH] D36089: [ELF] - Replace parallelForEach with ranged form.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 18:41:19 PDT 2017


Pete Cooper <peter_cooper at apple.com> writes:

>> On Aug 1, 2017, at 4:16 PM, Rafael Avila de Espindola <rafael.espindola at gmail.com> wrote:
>> 
>> George Rimar <grimar at accesssoftek.com> writes:
>> 
>>> I used LLVM algorithms like llvm::find_if, llvm::find as areference. 
>>> They use r-value and I think they do that to support constructions like:
>>> parallelForEach(std::vector<int>({1, 2, 3}), [](int) { ... });
>>> 
>>> I could probably use "const R &Range" for supporting above, 
>>> but use of r-value is just consistent.
>> 
>> Pete, looks like you added the first one of these (all_of). Do you
>> remember why you used r-value instead of const references?
> Looks like it spun out of feedback from Dave Blaikie, but I don't see a specific suggestion to use r-value, so i honestly can't really remember.
>
> See http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150511/276117.html <http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150511/276117.html> for more details, not that it has the r-value stuff.

David,

Do you remember why all_of and related functions use r-value references
instead of const references?

Cheers,
Rafael


More information about the llvm-commits mailing list