+pilgrim@ since this is a continuation of issue 672902
FWIW, IsBlacklistedFreeFunctionName blacklists "swap". OTOH, I see that std::vector also has a |swap| instance method. It would be great if the standard library documentation would document which things its templates depend on - do we know of such an interop doc that spells whether the naming of |swap| *instance method* is important VS only the naming of |swap| *free function* is important? I guess similar questions can be asked about |data| and |capacity|.
Also - *how* did we come up with a list of things tackled in issue 662431?
Also need to consider things like length() and size(), which we ignored for the rename--but arguably for a few things they should be capitalized in the standard way.
I think it is worth noting that //base is somewhat inconsistent here:
- base::flat_set has methods called |size|, |erase|, |swap|, |clear|
- base::MRUCache has methods called |size|, |Erase|, |Swap|, |Clear|
- base::DictionaryValue has methods called |size|, |Remove|, |Swap|, |Clear|
- base::IDMap has methods called |size|, |Remove|, |Clear|
It would be great if whatever agreement we can reach here would also apply to //base.
I think the main criteria is if we expect the class to be a drop-in replacement for an STL type. HashCountedSet isn't exactly a drop-in but it's close enough (and other WTF containers like Vector, HashMap are), whereas DictionaryValue/IDMap/MRUCache have fairly different semantics. So we're mainly going to focus on WTF containers here.
There's debate over what to do for smart pointers, but I'm inclined to just leave that particular issue alone (since the smart pointers themselves are fairly distinct from anything in the STL, except maybe RefPtr)
Re: resize(), yes. I don't have an exhaustive list, but things like find(), count(), are also being reverted.
Comment 1 by lukasza@chromium.org
, Apr 10 2017