With RVO we would not need copy or move.
-----Ursprüngliche Nachricht-----
Von: SD SH via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Di 21.10.2025 14:02
Betreff: Re: [std-proposals] Forwarding Reference can also accept PRvalue (not just Lvalue or Rvalue)
An: std-proposals@lists.isocpp.org;
CC: SD SH <Z5515zwy@outlook.com>;
Then how will you implement it?Think of this:```SYSCLASS struct Accessor; // unmovable and uncopyableextern SYSAPI Accessor (*access)();int main() {StoreAndGet<Accessor>(access());}```We don't know what the function will do, and it's impossible to change the function. We only know that access() will construct a Accessor object and follow the calling convention, then we must call copy or move constructor, but in this case we can't do it.For your example, if a function returns a unmovable and uncopyable object means that you shouldn't construct it by existing objects in your code.