Boost logo

Boost :

From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2002-01-29 17:39:07

Douglas Gregor wrote:
> > I recently discovered that nontype template parameters
> > other than integers are much better supported across
> > compilers than I had previously expected, so now I'm
> > on the lookout for uses. I have to thank Andrei
> > Alexandrescu for putting the thought in my mind; I read
> > that he was doing that with function pointers in an
> > article I saw somewhere.
> This would be the way to stuff a member function pointer +
> "this" pointer into a Boost.Function object without taking up
> any additional space.

Yes, in fact, going this route would allow us to write a version of
'function<>' class that would take _less_ space than the current
implementation (1 function pointer + 1 data pointer, instead of current 2
function pointers plus + 1 function/data pointer).

So, returning to the original suggestion ('bind(&my:foo, this)'
optimization) - can we have it? :)


Boost list run by bdawes at, gregod at, cpdaniel at, john at