Hello,
I quickly read what you sent,
And I have a question:
Isn't there a "typeinfo" header containing something able to hold type information? There is typeindex also, if I'm not mistaken.
Maybe the only thing you need is to be able to use such types in a dynamic_cast

In any case, I see a very useful use-case for an argument parser for instance.

Antoine Viallon


De : Jaroslav Moravec via Std-Proposals <std-proposals@lists.isocpp.org>
Envoyé : 13 juillet 2021 14:44:50 GMT+02:00
À : std-proposals@lists.isocpp.org
Cc : Jaroslav Moravec <j.moravec.email@seznam.cz>
Objet : [std-proposals] A new proposal, new key-word definition for dynamic, run-time type-cast operations

New proposal, version 2.

Abstract

The C++ language is here for more that 36 years and is still under development. Sometimes, C++ borrows some ideas from other programming languages, sometimes works on its own way. Presented proposal try to introduce a new type of basic variable which would be capable to hold a type of a variable or a type of a class or a struct. This variable should be capable to define target new type in type-cast operations such us: static_cast or dynamic_cast etc. Both at running time and at compilation time. Type of a variable or a class/struct is usually given by its unique name. Thus, the new basic variable should contain a string – the name of basic datatype or a type of user defined datatype. This name is then used in the type-cast operation at running time. The target type is, of course, well known at compilation time.