Document that swisstable and b-tree containers are not exception-safe.
For performance reasons, these containers are optimized for the case in which allocations/deallocations/comparisons/hashers can't throw exceptions.
PiperOrigin-RevId: 645054627
Change-Id: I99be651b26f5bbb87da6ef246b92b20a375224d7
diff --git a/absl/container/btree_map.h b/absl/container/btree_map.h
index 3515838..b959b67 100644
--- a/absl/container/btree_map.h
+++ b/absl/container/btree_map.h
@@ -49,6 +49,8 @@
//
// Another API difference is that btree iterators can be subtracted, and this
// is faster than using std::distance.
+//
+// B-tree maps are not exception-safe.
#ifndef ABSL_CONTAINER_BTREE_MAP_H_
#define ABSL_CONTAINER_BTREE_MAP_H_
diff --git a/absl/container/btree_set.h b/absl/container/btree_set.h
index 6e123ce..986d27d 100644
--- a/absl/container/btree_set.h
+++ b/absl/container/btree_set.h
@@ -48,6 +48,8 @@
//
// Another API difference is that btree iterators can be subtracted, and this
// is faster than using std::distance.
+//
+// B-tree sets are not exception-safe.
#ifndef ABSL_CONTAINER_BTREE_SET_H_
#define ABSL_CONTAINER_BTREE_SET_H_
diff --git a/absl/container/flat_hash_map.h b/absl/container/flat_hash_map.h
index 1c43e92..3eae404 100644
--- a/absl/container/flat_hash_map.h
+++ b/absl/container/flat_hash_map.h
@@ -26,6 +26,8 @@
//
// In most cases, your default choice for a hash map should be a map of type
// `flat_hash_map`.
+//
+// `flat_hash_map` is not exception-safe.
#ifndef ABSL_CONTAINER_FLAT_HASH_MAP_H_
#define ABSL_CONTAINER_FLAT_HASH_MAP_H_
diff --git a/absl/container/flat_hash_set.h b/absl/container/flat_hash_set.h
index 7b9e006..e284a7d 100644
--- a/absl/container/flat_hash_set.h
+++ b/absl/container/flat_hash_set.h
@@ -26,6 +26,9 @@
//
// In most cases, your default choice for a hash set should be a set of type
// `flat_hash_set`.
+//
+// `flat_hash_set` is not exception-safe.
+
#ifndef ABSL_CONTAINER_FLAT_HASH_SET_H_
#define ABSL_CONTAINER_FLAT_HASH_SET_H_
diff --git a/absl/container/node_hash_map.h b/absl/container/node_hash_map.h
index 4bba130..7b74b4b 100644
--- a/absl/container/node_hash_map.h
+++ b/absl/container/node_hash_map.h
@@ -32,6 +32,8 @@
// migration, because it guarantees pointer stability. Consider migrating to
// `node_hash_map` and perhaps converting to a more efficient `flat_hash_map`
// upon further review.
+//
+// `node_hash_map` is not exception-safe.
#ifndef ABSL_CONTAINER_NODE_HASH_MAP_H_
#define ABSL_CONTAINER_NODE_HASH_MAP_H_
diff --git a/absl/container/node_hash_set.h b/absl/container/node_hash_set.h
index 82e4923..7228d19 100644
--- a/absl/container/node_hash_set.h
+++ b/absl/container/node_hash_set.h
@@ -31,6 +31,8 @@
// `node_hash_set` should be an easy migration. Consider migrating to
// `node_hash_set` and perhaps converting to a more efficient `flat_hash_set`
// upon further review.
+//
+// `node_hash_set` is not exception-safe.
#ifndef ABSL_CONTAINER_NODE_HASH_SET_H_
#define ABSL_CONTAINER_NODE_HASH_SET_H_