[PATCH] D49985: [ADT] ImmutableList no longer requires elements to be copy constructible
George Karpenkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 13 10:18:13 PDT 2018
george.karpenkov added inline comments.
================
Comment at: include/llvm/ADT/ImmutableList.h:172
- LLVM_NODISCARD ImmutableList<T> concat(const T &Head, ImmutableList<T> Tail) {
+ LLVM_NODISCARD ImmutableList<T> concat(T Head, ImmutableList<T> Tail) {
// Profile the new list to see if it already exists in our cache.
----------------
Shouldn't we have `&&` here as well for Head?
================
Comment at: include/llvm/ADT/ImmutableList.h:194
- LLVM_NODISCARD ImmutableList<T> add(const T& D, ImmutableList<T> L) {
- return concat(D, L);
+ LLVM_NODISCARD ImmutableList<T> add(T Data, ImmutableList<T> L) {
+ return concat(std::move(Data), L);
----------------
And for Data?
https://reviews.llvm.org/D49985
More information about the llvm-commits
mailing list