From 0c03c28a3b7609d218a9acdff099fc0bda0f4ae6 Mon Sep 17 00:00:00 2001 From: Gil Date: Fri, 20 Apr 2018 12:11:19 -0700 Subject: 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 --- Firestore/core/src/firebase/firestore/immutable/sorted_map_base.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Firestore/core/src/firebase/firestore/immutable/sorted_map_base.h') 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(-1); }; } // namespace impl -- cgit v1.2.3