From: Marco (mrcekets_at_[hidden])
Date: 2007-10-05 08:24:25
On Tue, 02 Oct 2007 21:15:06 +0200, Marco Costalba <mcostalba_at_[hidden]>
> On 10/2/07, Marco <mrcekets_at_[hidden]> wrote:
>> However your last changes makes the code too complicated, IMO.
>> I made up a metafunction called wrapper that should do the work.
> Yes your metafunction is nice but I wanted to reuse the same
> 'do_compose' struct already used for getting the linear hineritance
> adding only a couple of lines (2 in the primary template, 1 in the
> Your is a general metafunction wrapper, my hack is very tailored for
> this task only.
I see, I tested your code and it works fine. :-)
In the meanwhile, I'm trying a different approach.
I would like to be able to deduce the signature of a functor without the
need of using index.
int foo1(char )
double foo2(int, char)
overload<int(char ), double(int, char )> f;
f = &foo1; // no index needed
f = &foo2; // the right assignment
// is achieved by deducing
// the argument signature
int i = f('x');
double d = f(123, 'x');
BOOST_ASSERT(i == 123);
BOOST_ASSERT(d > 123.455 && d < 123.457);
this is enough simple when the argument is a function pointer but can be
more complex in other cases.
I hope to be able to post some result, soon.
-- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk