C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::arithmetic (concept)

From: Thiago Macieira <thiago_at_[hidden]>
Date: Fri, 18 Apr 2025 07:33:55 -0700
On Friday, 18 April 2025 02:44:21 Pacific Daylight Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> So far we've talked about 3 or 4 different ways of tagging a class,
> and some of these ways of tagging a class are inherited by a derived
> class. We could standardise this so that everyone's doing it the same
> way and so it's more explicit and verbose. Plus it would be nice to
> able to iterate through a classes tags:
>
> class MyClass {
> _Tag arithmetic;
> };
>
> int main(void)
> {
> for ( auto &t : typeid(MyClass).tags ) /* Do Something */ ;
> }
>
> But that would probably be an extension to the 'reflection' papers.

Then the proposal should be made in conjunction with reflection. A core
language change should provide significant benefit over the existing techniques
and this could be one.

Without the reflection, this becomes https://xkcd.com/927/

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering

Received on 2025-04-18 14:34:01