diff options
author | Gil <mcg@google.com> | 2018-04-20 12:11:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-20 12:11:19 -0700 |
commit | 0c03c28a3b7609d218a9acdff099fc0bda0f4ae6 (patch) | |
tree | 944ffbf8158b1faf75d8baa09abaec427b699222 /Firestore/core/src/firebase/firestore/immutable/sorted_map_base.h | |
parent | ede57f84bb4ddcc438bba34ef4407ee86fbaf2f9 (diff) |
Implement find-related methods on C++ immutable maps (#1145)
* Standardize method ordering across sorted maps
* Add SortedMap::find
* Add SortedMap::find_index
* Add SortedMap::contains
Diffstat (limited to 'Firestore/core/src/firebase/firestore/immutable/sorted_map_base.h')
-rw-r--r-- | Firestore/core/src/firebase/firestore/immutable/sorted_map_base.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Firestore/core/src/firebase/firestore/immutable/sorted_map_base.h b/Firestore/core/src/firebase/firestore/immutable/sorted_map_base.h index cfb19c1..a19bd77 100644 --- a/Firestore/core/src/firebase/firestore/immutable/sorted_map_base.h +++ b/Firestore/core/src/firebase/firestore/immutable/sorted_map_base.h @@ -54,6 +54,12 @@ class SortedMapBase { */ // TODO(wilhuff): actually use this for switching implementations. static constexpr size_type kFixedSize = 25; + + /** + * A sentinel return value that indicates not found. Functionally similar to + * std::string::npos. + */ + static constexpr size_type npos = static_cast<size_type>(-1); }; } // namespace impl |