C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Function overload set type information loss

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Tue, 30 Jul 2024 17:14:12 +0200
The syntax would be one of the last things to consider. Much more important is, what kind of thing you are talking of, what operations are possible, why it cannot be done with current C++   Are the origin template parameters part of a new (more complex) type? Would more code be templated? Or is it a powerful form of reflection without any change to the type system? But the compiler goes back to the assignment, if possible?   That is the base decision on, what you are actually proposing. Depending on it, we could know, whether this information is transferred into functions through their parameters.       -----Ursprüngliche Nachricht----- Von:organicoman via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Di 30.07.2024 17:06 Betreff:Re: [std-proposals] Function overload set type information loss An:Jonathan Wakely <cxx_at_[hidden]>; CC:organicoman <organicoman_at_[hidden]>; std-proposals_at_[hidden];    But what is '<int>(double)'? That's not a thing that can be represented in C++ today. It's not a type, so you're inventing an entire new category of "thing" in the language.  Correct, it is not a correct C++ syntax. And yes, it is an invent new thing  You need a *much* more complete proposal for such a thing, explaining how it works, how to use it, and why it would be different from a meta object proposed by the Reflection papers.  I was looking at Clang implementation of variable templates, the infrastructure to implement the above is there, but seriously to add parsing of such syntax is not trivial. So a decision should be taken, to either make that syntax and internal compiler idiom, and let the user only refer to it through an operator, like for example: effective_decltype() Then add some type traits to manipulate that unnamed type. Or make it a concrete syntax. I hope that one of compilers implementers would adopt the idea. As for its usefulness, it is as good as meta object, with the benefits of using compile time meta programming, since we are dealing with types directly.

Received on 2024-07-30 15:14:15