C++ Logo

std-proposals

Advanced search

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

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Wed, 31 Jul 2024 12:21:28 +0200
Hi Nadir,   I hope it is clear for you, which of the four somewhat different ideas you want to propose and know the shortcomings for each. Please do not mix those ideas all in one paper, as you did in the posts to this mailing list (at least that was my reading/impression):   a) If a type is deduced by auto and stored in a variable (lvalue), the deduction information (e.g. template parameters) is locally retained, so that it can be reflected at compile-time (that would not work with push_back)   b) For templated functions, the address can be used at runtime to determine, which template instantiation it was (some technical difficulties, if the template instantiations span different compilation units, so the code as switch case or as hashmap can only be created at linktime; alternatively before each function entry point, data is stored, like a pointer to a struct with type information)   c) wrapper types (with optional nicer syntax to hide them), which store the template parameters in the static type, useable at compile-time (not usable for push_back without some further measures)   d) dynamic type information in the likes of std::any, which store the type information for runtime-use   Best, Sebastian   -----Ursprüngliche Nachricht----- Von:organicoman <organicoman_at_[hidden]> Gesendet:Mi 31.07.2024 11:21 Betreff:Re: [std-proposals] Function overload set type information lossAnyway, I think we touched everything in this thread, and thanks to you and Tiago i found a corner case, but solved it. I think it is time to compile some wording and post it here, maybe it will be more clear.  

Received on 2024-07-31 10:21:31