Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-29 17:44:34


I don't see how this is going to work. Once you pass a function pointer into
a function call between parens (e.g. bind(&my::foo...)) it becomes a runtime
entity, and is unavailable as a template parameter.

What am I missing?

----- Original Message -----
From: "Aleksey Gurtovoy" <alexy_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, January 29, 2002 5:39 PM
Subject: RE: [boost] function/bind ideas

> 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? :)
>
> Aleksey
>
> Info: http://www.boost.org Send unsubscribe requests to:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk