C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::elide

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Sun, 26 May 2024 22:24:39 +0100
On Sun, May 26, 2024 at 2:02 AM Lorand Szollosi wrote:
>
> The real-world problems are:
> 1. how to return a char const* to a callee-created char const[fixed_N]
> that then the caller deallocates (e.g. mocks, char-to-wchar API
> strings, etc.)
> 2. how to have a make function for a non-movable class that can fail,
> without throwing exceptions
> 3. an alternative with way less noise for in-class description (e.g. field
> names in serialization, optionality, etc.)
> 4. how to do a post-constructor setup on a non-movable class without
> heap allocation


Sebastian had a good idea to have a new standard library function
called 'std::factory', and I've written a paper about it just now:

    std::factory : http://www.virjacode.com/papers/factory.htm

So that means we now have 3 papers to choose from in order to achieve
NRVO. Here are the other two:

    Return Slot : http://www.virjacode.com/papers/returnslot.htm

    Anton's NRVO paper :
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2025r2

Received on 2024-05-26 21:24:51