
4 Sep
2011
4 Sep
'11
9:12 a.m.
On 09/04/2011 11:32 AM, Artyom Beilis wrote:
What if we keep the pointer to the type_info in impl, but make it directly accessible, not via a virtual call? This would keep sizeof(any) to one pointer and only add one indirection to any4. IMHO, that would be the best solution.
This is fine as well. However I don't see too much advantage of having one pointer instead of two.
Empty anys will take less space, which may be significant. Moving and swapping will also be cheaper.
The most important is **not reinvent** RTTI as it would not work well.
No argument from me on that. :)