
On Tue, Jul 20, 2010 at 11:06 AM, Daniel Walker <daniel.j.walker@gmail.com>wrote:
On Tue, Jul 20, 2010 at 10:45 AM, David Sankel <camior@gmail.com> wrote:
On Mon, Jul 19, 2010 at 6:42 PM, Daniel Walker < daniel.j.walker@gmail.com>wrote:
On Mon, Jul 19, 2010 at 5:37 PM, David Sankel <camior@gmail.com> wrote:
I'm wondering if there's a way I can generically get the result type of boost bind. To my knowledge there is no general way to declare the return type of boost::bind (or a Boost Lambda expression). In C++03 the best we can do is boost::function, which can store arbitrary function objects without having to know the type.
Thanks Daniel. I have found a way do, somewhat awkwardly, what I want in C++03 so I'll give my solution below.
But this is not a generic solution. It is a very specific solution that relies on internal types and implementation details of boost::bind. It may not work for all releases of boost::bind and may not work with other bind implementations.
Thanks for clarifying what I meant by awkward. Is it possible, and if so how, to make a generic solution? The main problem I see is bind taking a type argument in some cases. Could boost.bind be modified to expose a result type? I haven't seen any reasons yet for bind not including this really useful feature. David -- David Sankel Sankel Software www.sankelsoftware.com 585 617 4748 (Office)