[PATCH] D53247: [ADT] Add initializer_list constructor, equality tests for DenseMap/DenseSet.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 13 20:08:55 PDT 2018


dblaikie added a comment.

Might be good to separate this into three or four (five? maybe, given the change to the DenseSet initial capacity?) separate changes - but mostly the only interesting question for me is about the equality



================
Comment at: include/llvm/ADT/DenseMap.h:656-659
+  for (auto LHSI = LHS.begin(), RHSI = RHS.begin(), E = LHS.end(); LHSI != E;
+       ++LHSI, ++RHSI)
+    if (*LHSI != *RHSI)
+      return false;
----------------
Is this guaranteed to work, given the lack of ordering guarantees? I think the order can depend on insertion order - so equivalent containers might have different iteration orders, perhaps?


Repository:
  rL LLVM

https://reviews.llvm.org/D53247





More information about the llvm-commits mailing list