
On Mar 3, 2017 17:58, "Peter Dimov via Boost"
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. Right, the trick is usually to figure out what consumes less memory, i.e. what leads to the least amount of distinct template instantiations. Alias templates help a lot with that, since they are not actually instantiated, but there is only so much one can do with alias templates alone. Bruno