C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Replace an object -- but retain old object if new object fails to construct

From: Oliver Hunt <oliver_at_[hidden]>
Date: Wed, 29 Oct 2025 20:39:07 -0700
> On Oct 29, 2025, at 5:05 PM, Frederick Virchanza Gotham via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> On Wed, Oct 29, 2025 at 9:51 PM Frederick Virchanza Gotham wrote:
>>
>>
>> How about if 'is_trivially_relocatable_v' were to be taken out and replaced with 'relocatability_v':
>>
>> namespace std {
>> template<typename T>
>> struct relocatability : integral_constant<int, . . . >{};
>> }
>
>
> Implementation might look something like this:
>
> https://godbolt.org/z/M57xh1TvY
>

Again: providing ad hoc implementations is not how standardisation works. This has been said by multiple people in many threads.

You need to write a specification, describing the exact behavior, in terms of things that exist in the standard, if they are not already in the standard you need to define those as well.

The specification describes the behavior, not the implementation. An implementation is a nicety, given the existence of the specification.

—Oliver

Received on 2025-10-30 03:39:10