
"Daniel Walker" <daniel.j.walker@gmail.com> wrote in message news:AANLkTinCj3avcSZtfm9jcCBfmcDVDbSyf4Cu8ZktumwY@mail.gmail.com...
On Sat, Nov 6, 2010 at 7:53 PM, Peter Dimov <pdimov@pdimov.com> wrote:
This is a special case: all targets are function pointers of the same type, right?
No. It's enough for one of them to be.
Oh, I see, if the user ever assigns a function pointer target, then you can reuse the vtable from the empty target. OK, that's a reasonable optimization, but it doesn't decrease the upper bound on space overhead, which is reached when no user-assigned target has the same type as the empty target.
That is not an optimization, it is just the correct way to do it and the way the current boost::function implementation already functions... -- "What Huxley teaches is that in the age of advanced technology, spiritual devastation is more likely to come from an enemy with a smiling face than from one whose countenance exudes suspicion and hate." Neil Postman