C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Delete...why not a parameter by reference?!

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Sun, 24 Aug 2025 22:28:49 +0300
On Sun, 24 Aug 2025 at 22:20, organicoman via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> It's a team work, with this proposal, we help library implementers to catch bugs.

Right. You want to pass a library a non-copy that's nullable and you
don't want the library to delete it, and there's teamwork
between you and the library.

Pass that library a std::optional<T&> instead of a T*.

Received on 2025-08-24 19:29:03