Skip to content

LWG-3595 Exposition-only classes proxy and postfix-proxy for common_iterator should be fully constexpr #2264

@AlexGuteniev

Description

@AlexGuteniev

LWG-3595 asks for constexpr members of common_iterator proxies proxy and postfix-proxy.

proxy is returned by operator-> so it is observable, need to implement the change for it.
postfix-proxy is not returned and not observable, in fact the STL does not have it. isadded by #1991 , and constexpr is observable.

Also noexcept for indirection operator is no longer strengthened.

Need to change the _Proxy_base, _Arrow_proxy and _Postfix_proxy classes:

STL/stl/inc/iterator

Lines 818 to 824 in 8833270

struct _Proxy_base {
iter_value_t<_Iter> _Keep;
explicit _Proxy_base(iter_reference_t<_Iter>&& _Right) noexcept(
is_nothrow_constructible_v<iter_value_t<_Iter>, iter_reference_t<_Iter>>) // strengthened
: _Keep(_STD forward<iter_reference_t<_Iter>>(_Right)) {}
};

STL/stl/inc/iterator

Lines 890 to 899 in 8833270

class _Arrow_proxy : private _Proxy_base {
public:
friend common_iterator;
using _Proxy_base::_Proxy_base;
_NODISCARD const iter_value_t<_Iter>* operator->() const noexcept /* strengthened */ {
return _STD addressof(this->_Keep);
}
};

STL/stl/inc/iterator

Lines 924 to 933 in 8833270

class _Postfix_proxy : private _Proxy_base {
public:
friend common_iterator;
using _Proxy_base::_Proxy_base;
_NODISCARD const iter_value_t<_Iter>& operator*() const noexcept /* strengthened */ {
return this->_Keep;
}
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    LWGLibrary Working Group issuefixedSomething works now, yay!

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions