[PATCH] D67668: [ADT] Add StringMap::insert_or_assign

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 18 19:04:49 PDT 2019


MaskRay added a comment.

In D67668#1674393 <https://reviews.llvm.org/D67668#1674393>, @dblaikie wrote:

> Could we have this as a standalone helper function (STLExtras or the like) rather than implementing it in every container?


We only need it in 2 unordered associative containers: DenseMap, and StringMap. Member methods have the advantage that they have better discoverability and can be easily be completed. This method is simple enough now. Placing it in STLExtras does not save much.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67668/new/

https://reviews.llvm.org/D67668





More information about the llvm-commits mailing list