Date: Wed, 2 Jul 2025 18:27:20 +0100
On Wed, 2 Jul 2025 at 16:39, Peter Bindels via Std-Proposals <
std-proposals_at_[hidden]> wrote:
>
> Practically I would go for just subsetting out array new entirely... but
> that could be complemented with a new type to wrap it safely that
> type-safely transports it across. Doesn't unique_ptr have a specialization
> that does this, and if so why not use it - if not why not add it there?
>
There's a specialization for std::unique_ptr<T[]> but not one for
std::unique_ptr<T[N]> because of ... reasons.
std::shared_ptr has specializations for both T[] and T[N], and maybe it's
time that we added std::unique_ptr<T[N]> back again (it was in a C++0x
draft but got removed).
std-proposals_at_[hidden]> wrote:
>
> Practically I would go for just subsetting out array new entirely... but
> that could be complemented with a new type to wrap it safely that
> type-safely transports it across. Doesn't unique_ptr have a specialization
> that does this, and if so why not use it - if not why not add it there?
>
There's a specialization for std::unique_ptr<T[]> but not one for
std::unique_ptr<T[N]> because of ... reasons.
std::shared_ptr has specializations for both T[] and T[N], and maybe it's
time that we added std::unique_ptr<T[N]> back again (it was in a C++0x
draft but got removed).
Received on 2025-07-02 17:27:40