diff options
author | 2017-10-05 19:52:46 -0400 | |
---|---|---|
committer | 2017-10-05 19:52:46 -0400 | |
commit | 764d4bd0fe96250c2d6e81595c04b15600576e0c (patch) | |
tree | 23d5ae8b9127b2cc5a3613cab4586d7d686a0793 /absl/types/optional.h | |
parent | 5e1a8e8daddc9bf04dcd41ae7028dd4298a839d1 (diff) | |
parent | d732f2014bdd141135e6af06ee5b47e7fbe4b877 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'absl/types/optional.h')
-rw-r--r-- | absl/types/optional.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/absl/types/optional.h b/absl/types/optional.h index f1b41ace..e952a04a 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; |