C++ Logo


Advanced search

Re: Does [expr.call]/1 correctly authorize the snippet below to compile?

From: J.A. Belloc <jabelloc_at_[hidden]>
Date: Mon, 14 Oct 2019 16:36:11 -0300
@Krystian Stasiowski

It took me some time to convince myself that the prvalue corresponding to
the return of the function g() containing the address of f is used directly
by the compiler to call f(1). That is, there is no need for the
materialization of such prvalue, into an xvalue, before the call to f, as I
was thinking before this discussion. Thanks for the input.

But regarding your observation "This is just another case where prvalue is
implied, like with the operands of almost every other operator.", where in
the standard does it say so?

On Thu, Oct 10, 2019 at 12:12 PM Krystian Stasiowski via Std-Discussion <
std-discussion_at_[hidden]> wrote:

> Sure, because when a glvalue appears in a context that requires a prvalue,
> the lvalue-to-rvalue, array-to-pointer or function-to-pointer conversions
> are performed.--
> Std-Discussion mailing list
> Std-Discussion_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion


Received on 2019-10-14 14:38:36