
4 Sep
2011
4 Sep
'11
4 p.m.
on Sun Sep 04 2011, Andrey Semashev <andrey.semashev-AT-gmail.com> wrote:
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.
+1 -- Dave Abrahams BoostPro Computing http://www.boostpro.com