3 Mar
2017
3 Mar
'17
4:58 p.m.
Bruno Dutra wrote:
OTOH the void* trick requires that a pack of M void pointers be instantiated when the element at position M is retrieved from a list, so, for a list of N elements, the compiler must instantiate N *distinct* packs of void pointers, because each of these packs have a different size and is thus a distinct type.
Not just that, but the helper function that is required to obtain the Mth element is a template instantiation as well. Saying that we shouldn't use map_from_list because it consumes memory for the instantiation is misleading; the alternatives consume memory for instantiations as well. Except for __type_pack_element, of course.