Re: [boost] Deterimining interest in: Optional Polymorphic V…

Top Page

Reply to this message
Author: Steven Wat
Date:  
To: boost
Subject: Re: [boost] Deterimining interest in: Optional Polymorphic Valueobject with Small Object optimization
AMDG

Corrado Zoccolo <czoccolo <at> gmail.com> writes:

> Because the vtables in C++ are not smart enough. If I make an hand made
> vtable, I can put not only function pointers, but also values inside it.
> This means that for example, I have to make a call through a function
> pointer to query if the object was allocated on heap or on stack, or if it
> has a no-throw copy constructor (all things that I can put directly in my
> hand made vtable).


There's another reason why a hand-made vtable is preferable
in the general case when you can have arbitrary user-defined
functions. A hand-made vtable allows you to take an arbitrary
subset of the functions without adding more layers of indirection.

In Christ,
Steven Watanabe


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost