aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/src/firebase/firestore/immutable/sorted_set.h
diff options
context:
space:
mode:
authorGravatar Konstantin Varlamov <var-const@users.noreply.github.com>2018-07-09 13:56:06 -0400
committerGravatar GitHub <noreply@github.com>2018-07-09 13:56:06 -0400
commit637e5aa468ab0c3b1faa3b7970ad3e91fb6c6f74 (patch)
treebcee145fb8095fb8bf5b6949bfa6901e2677a546 /Firestore/core/src/firebase/firestore/immutable/sorted_set.h
parenta5eb8952f8eadf1f59de1b0e7e9b91d497664fa7 (diff)
C++: for immutable data structures, forbid ignoring result of insert/erase
Diffstat (limited to 'Firestore/core/src/firebase/firestore/immutable/sorted_set.h')
-rw-r--r--Firestore/core/src/firebase/firestore/immutable/sorted_set.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Firestore/core/src/firebase/firestore/immutable/sorted_set.h b/Firestore/core/src/firebase/firestore/immutable/sorted_set.h
index 1fe91bd..e4d340a 100644
--- a/Firestore/core/src/firebase/firestore/immutable/sorted_set.h
+++ b/Firestore/core/src/firebase/firestore/immutable/sorted_set.h
@@ -25,6 +25,7 @@
#include "Firestore/core/src/firebase/firestore/util/comparison.h"
#include "Firestore/core/src/firebase/firestore/util/hard_assert.h"
#include "Firestore/core/src/firebase/firestore/util/hashing.h"
+#include "absl/base/attributes.h"
namespace firebase {
namespace firestore {
@@ -76,11 +77,11 @@ class SortedSet {
return map_.size();
}
- SortedSet insert(const K& key) const {
+ ABSL_MUST_USE_RESULT SortedSet insert(const K& key) const {
return SortedSet{map_.insert(key, {})};
}
- SortedSet erase(const K& key) const {
+ ABSL_MUST_USE_RESULT SortedSet erase(const K& key) const {
return SortedSet{map_.erase(key)};
}