C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::elide

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Thu, 23 May 2024 15:32:21 +0000

> What kind of semantic ambiguities are you talking about?

You cannot declare :
int[3] func();

Which would have been required for NRVO to function on a c-style array. Even if you tried:

auto func()
{
  int var[3];
return var;
}

What you get is an int* and not an array, because of the implicit decay of var as the address of the array.
Even with NRVO this would never work for c-style arrays. It is a completely different problem to solve, and not relevant to RVO.

Received on 2024-05-23 15:32:27