[PATCH] D23252: [ADT] Extra STLExtras
bryant via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 10 10:52:52 PDT 2016
bryant added inline comments.
================
Comment at: include/llvm/ADT/STLExtras.h:301
@@ +300,3 @@
+ typedef typename NatList<sizeof...(Args)>::eval nat_list;
+ std::tuple<Args...> ts;
+
----------------
dblaikie wrote:
> This keeps a copy (or move) of all its arguments to allow for the rvalue case in a range-for loop? That would have surprising performance characteristics (implicit whole-container copies) for non-temporary parameters...
>
> I think that gets into some pretty major design questions about the behavior here - and the major design problem/question with range proposals in general.
>
> We might need to have a broader discussion about the design for anything like this - might be worth moving that part of the conversation to llvm-dev as I expect it'll be a bit more involved. But maybe here's OK & we can rope a few people in.
>
>
if by "non-temporary" you mean lvalue input, then no. the corresponding tuple member would be a reference. if it were a copy, the mutability demo in unit test wouldn't work. please correct me if i've misunderstood your question.
Repository:
rL LLVM
https://reviews.llvm.org/D23252
More information about the llvm-commits
mailing list