Index: base/containers/README.md |
diff --git a/base/containers/README.md b/base/containers/README.md |
index e64e8f3a637162d1b43b7d4df0f90e705289ecc9..2d3a08144a28dfc542b332a5e2277a1ec14f0cfb 100644 |
--- a/base/containers/README.md |
+++ b/base/containers/README.md |
@@ -46,7 +46,7 @@ Google naming. Be sure to use the base namespace. |
* **base::small\_map** has better runtime memory usage without the poor |
mutation performance of large containers that base::flat\_map has. But this |
advantage is partially offset by additional code size. Prefer in cases |
- where you make many objects so that the code/heap tradeoff is good. |
+ where you make many objects so that the code/heap tradeoff is good. |
* Use **std::map** and **std::set** if you can't decide. Even if they're not |
great, they're unlikely to be bad or surprising. |
@@ -124,6 +124,15 @@ strategy and the memory access pattern. Assuming items are being linearly added, |
one would expect it to be 3/4 full, so per-item overhead will be 0.25 * |
sizeof(T). |
+By default they use base::less instead of std::less which adds a few extra |
+features: |
+a) base::less is based on std::less<> from C++14, therefore you can,for example, |
+ lookup base::StringPiece in a set of strings without constructing a temporary |
+ string. |
+b) base::less operator() is specialized for SmartPointer to pointer comparisons |
+ so you can directly use, for example, flat_set<\std::unique\_ptr> and use |
+ raw pointers as keys if necessary. |
+ |
### base::small\_map |
A small inline buffer that is brute-force searched that overflows into a full |