C++ Logo

std-discussion

Advanced search

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

From: Krystian Stasiowski <sdkrystian_at_[hidden]>
Date: Mon, 14 Oct 2019 15:41:40 -0400
It doesn't, that's why it's implied.
-------- Original message --------From: "J.A. Belloc via Std-Discussion" <std-discussion_at_[hidden]> Date: 10/14/19 15:36 (GMT-05:00) To: std-discussion_at_[hidden] Cc: "J.A. Belloc" <jabelloc_at_[hidden]> Subject: Re: [std-discussion] Does [expr.call]/1 correctly authorize the snippet below to compile? @Krystian StasiowskiIt 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
-- Belloc

Received on 2019-10-14 14:43:58