C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Language support for type erasure

From: Alejandro Colomar <une+cxx_std-proposals_at_[hidden]>
Date: Sun, 12 Apr 2026 17:15:53 +0200
Hi Simon,

On 2026-04-12T16:29:14+0200, Simon Schröder via Std-Proposals wrote:
> I’m thinking about reflection in this context. Herb Sutter already
> suggested meta classes as a reflection concept. I’m not entirely sure
> if I remember this correctly, but I believe one of his examples was
> that we write an interface class (one where there are only
> declarations of member methods, but no definitions). With a meta class
> (basically a compile time function that is applied to your own class)
> we could automatically create your Animal class.
>
> BTW, I believe typedef is dead and using is the new hero in town.
> Though if the use of traditional typedef fades out eventually we might
> be able to reuse the keyword in the future.

If C++ wants to keep any compatibility with C, you will never be able to
reuse it. We're currently dealing with the consequences of 'auto' in C,
and they're small because it was never used that much in C either. But
breaking typedef would be like declaring that C++ will stop being
compatible with C at all.

> But, does C have ‘using’ now?

No.

> Or still just typedef?

Yes. And it's used everywhere.

> In the latter case we will still have plenty of code with the
> traditional meaning of typedef.


Have a lovely day!
Alex

-- 
<https://www.alejandro-colomar.es>

Received on 2026-04-12 15:16:05