C++ Logo

std-proposals

Advanced search

Re: A new proposal, new key-word definition for dynamic, run-time type-cast operations

From: Antoine Viallon <antoine_at_[hidden]>
Date: Tue, 13 Jul 2021 15:01:31 +0200
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


-------- Courriel d’origine --------
De : Jaroslav Moravec via Std-Proposals <std-proposals_at_[hidden]>
Envoyé : 13 juillet 2021 14:44:50 GMT+02:00
À : std-proposals_at_[hidden]
Cc : Jaroslav Moravec <j.moravec.email_at_[hidden]>
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.

Received on 2021-07-13 08:01:38