aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-07-23 11:46:05 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2024-07-25 11:53:05 +0100
commit4b55cd211f33200b3c25afe138853351ce4ac4d3 (patch)
treec1872320a8434029ec0bfa7ce93f3565a68d6813 /gcc
parenteb2c12561c10f78e03b4eb63685f937a107305f0 (diff)
downloadgcc-4b55cd211f33200b3c25afe138853351ce4ac4d3.zip
gcc-4b55cd211f33200b3c25afe138853351ce4ac4d3.tar.gz
gcc-4b55cd211f33200b3c25afe138853351ce4ac4d3.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 'gcc')
0 files changed, 0 insertions, 0 deletions