$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Larry Evans (cppljevans_at_[hidden])
Date: 2004-11-18 13:22:47
On 11/18/2004 07:00 AM, Daniel James wrote:
> I've written a macro (the implementation is attached) for generating a
> function object for using overloaded functions with generic code such as
> the STL algorithms and boost::bind. A simple example of it's use:
[snip]
> Any comments on this? Would anyone else find this useful? Also, has
> anyone done something similar? I'd be surprised if no one has, I always
> feel like I'm missing something when I'm doing this kind of thing.
>
> The implementation is lacking in several ways - it doesn't work for
> non-const references, the return type is fixed, needs to deal with
I encountered the same problem with non-const references and the only
work-around I found was to use mpl::vector<T0,T1,...,TN> as the 1st
argument to the forwarding function. See:
and its use in overhead_referent_vals.hpp in that directory. Also,
there's tests for 0 and 1 arguments in the corresponding
libs/managed_ptr/test/smart_ptr_test.cpp.
If the additional mpl::vector arg is not acceptable, maybe it could
be curried away. I remember David Abraham had some currying code
somewhere. Maybe it's in mpl also.
HTH,
Larry