diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-07-23 11:46:05 +0100 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2024-07-28 19:05:56 +0200 |
commit | 13c94d827596cb90c53e35e0c6839e10c0944d25 (patch) | |
tree | b7f2fe8fc0872c2994d24673e23605222183e458 /libcpp | |
parent | 5b1ead44898908123560a7e4f2be237b2ef53cb9 (diff) | |
download | gcc-13c94d827596cb90c53e35e0c6839e10c0944d25.zip gcc-13c94d827596cb90c53e35e0c6839e10c0944d25.tar.gz gcc-13c94d827596cb90c53e35e0c6839e10c0944d25.tar.bz2 |
libstdc++: Use _M_get() in std::optional internals
Now that _base::_M_get() doesn't check the precondition, we can use
_M_get() instead of operator*() for the internal uses where we've
already checked the precondition holds.
Add a using-declaration so that we don't need to lookup _M_get in the
dependent base class, and make optional<U> a friend so that the
converting constructors and assignment operators can use the parameter's
_M_get member.
libstdc++-v3/ChangeLog:
* include/std/optional (optional): Add using-declaraction for
_Base::_M_get and declare optional<U> as friend.
(optional(const optional<U>&)): Use
_M_get instead of operator*.
(optional(optional<U>&&)): Likewise.
(operator=(const optional<U>&)): Likewise.
(operator=(optional<U>&&)): Likewise.
(and_then, tansform): Likewise.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions