C++ Logo

sg7

Advanced search

Re: [isocpp-sg7] SG7 late paper P3493R0 - Ruminations on reflection and access

From: Peter Dimov <pdimov_at_[hidden]>
Date: Wed, 13 Nov 2024 02:10:36 +0200
Aurelien Cassagnes wrote:
> Naively and very handwavely, if I dont want users of my types to be able to
> reflect arbitrarily over it, what i want is a way to overload ^^ operator for my
> type and either assert(false) there to lock everything, or shape up some kind
> of bespoke meta::info to be returned that fit my needs.

As I said last time this came up, we've already been on this path before, with
the unary operator&. People did what you wanted, overloaded op& and
asserted, or returned something bespoke that I'm sure fit their needs, and as
a result we had to add std::addressof which is operator&, except it bypasses
those people.

Received on 2024-11-13 00:10:41