Date: Fri, 20 Feb 2026 10:42:16 -0800
It wouldn't though: foo would't be binding to a temporary, it would be
binding to the result of doing ".member" on the temporary.
On Fri, Feb 20, 2026 at 10:39 AM Marcin Jaczewski via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> Paper suggests rewriting `ptr->meber` by `(*ptr).member`.
>
> But this creates an interesting case, new `->` created this way will
> have capabilities impossible compared to manually written `->`.
>
> Consider example:
> ```
> const auto& foo = ptr->member;
> ```
> and `ptr` that has a `*` returning proxy value.
> With this rewrite, the lifetime of the proxy object will be expanded
> to the lifetime of the `foo` reference.
> Using user defined `->` you can't in anyway do this as this operator
> is required to return pointer and not value (as it will call nested of `->`).
>
> This is expected behavior? If yes then maybe we should
> discourage of further use of user defined `->` operator?
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
binding to the result of doing ".member" on the temporary.
On Fri, Feb 20, 2026 at 10:39 AM Marcin Jaczewski via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> Paper suggests rewriting `ptr->meber` by `(*ptr).member`.
>
> But this creates an interesting case, new `->` created this way will
> have capabilities impossible compared to manually written `->`.
>
> Consider example:
> ```
> const auto& foo = ptr->member;
> ```
> and `ptr` that has a `*` returning proxy value.
> With this rewrite, the lifetime of the proxy object will be expanded
> to the lifetime of the `foo` reference.
> Using user defined `->` you can't in anyway do this as this operator
> is required to return pointer and not value (as it will call nested of `->`).
>
> This is expected behavior? If yes then maybe we should
> discourage of further use of user defined `->` operator?
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2026-02-20 18:42:33
