C++ Logo

std-proposals

Advanced search

Re: [std-proposals] New intrinsic type -- prvalue

From: Thiago Macieira <thiago_at_[hidden]>
Date: Mon, 20 Oct 2025 13:12:38 -0700
On Sunday, 19 October 2025 15:24:06 Pacific Daylight Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> The compiler would have its work cut out for it here. Normally when
> you write a function and give it a forwarding reference for a
> parameter (i.e. T&&), the compiler only has to generate two real
> functions (one that takes an Lvalue, one that takes an Rvalue)

We're talking about a template function whose body is visible to the compiler.
The chance that such a function would be inlined is greater than 90%.

So what problem are we really solving if the function did get inlined?

I don't think there is a problem that needs solving in the first place. Please
provide a concrete case (or preferably three) where you've found that not only
the compiler made a bad decision, it had no sufficient information to make a
good decision in the first place.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Data Center Group

Received on 2025-10-20 20:12:50