C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::type_info::size()

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Mon, 31 Jul 2023 16:37:25 +0200
As far as I understand, the implementation would have to store the size for each type (even for heavily template meta-programmed programs), which would incur overhead. As workaround you could register the respective types with their sizes instead, e.g. in some kind of map. -----Ursprüngliche Nachricht----- Von:Frederick Virchanza Gotham via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Mo 31.07.2023 15:35 Betreff:[std-proposals] std::type_info::size() An:std-proposals <std-proposals_at_[hidden]>; CC:Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>; I just realised today that you can't get the size of a type from its type_info. Really. . . . . . . ? Surely we should be able to do: void Func(std::type_info const &ti) { cout << ti.size() << endl; } -- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2023-07-31 14:37:27