C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::chimeric_ptr

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Fri, 30 Jan 2026 16:31:03 +0000
On Wed, Dec 10, 2025 at 2:40 PM Bjorn Reese wrote:
>
<snip>
> the chimeric pointer does not really behave like a (smart) pointer.
> For example, any facility using the INVOKE requirement [func.require]
> fails, such as std::invoke(&Editor::Edit, ptr), where ptr is a
> chimeric_ptr. As another example, std::to_address(ptr) fails with a
> confusing error message.


Just now I've made draft No. 5 of the paper for chimeric_ptr, you can
find it here:

    https://www.virjacode.com/papers/chimeric_pointer.htm

Changes:
1) Now works with member pointers, as well as invoke and apply.
2) User conversion is favoured over a static upcast.
3) Extra options for exception handling (e.g. nothrow_resolve,
nothrow_construct).
4) Aligned to two-pointers size so that you can use 'atomic_ref'.

I'm not entirely sure if chimeric_ptr should work with 'to_address',
but I suppose I could make it return the address of the first
interface.

Received on 2026-01-30 16:31:17