aboutsummaryrefslogtreecommitdiffhomepage
path: root/absl/types/optional.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/types/optional.h')
-rw-r--r--absl/types/optional.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/absl/types/optional.h b/absl/types/optional.h
index f1b41ac..e952a04 100644
--- a/absl/types/optional.h
+++ b/absl/types/optional.h
@@ -118,6 +118,13 @@ namespace absl {
// and `is_nothrow_swappable()` is the same as `std::is_trivial()`.
// * `make_optional()` cannot be declared `constexpr` due to the absence of
// guaranteed copy elision.
+// * The move constructor's `noexcept` specification is stronger, i.e. if the
+// default allocator is non-throwing (via setting
+// `ABSL_ALLOCATOR_NOTHROW`), it evaluates to `noexcept(true)`, because
+// we assume
+// a) move constructors should only throw due to allocation failure and
+// b) if T's move constructor allocates, it uses the same allocation
+// function as the default allocator.
template <typename T>
class optional;