Boost logo

Boost :

From: Marco Costalba (mcostalba_at_[hidden])
Date: 2007-10-05 12:53:45

On 10/5/07, Marco <mrcekets_at_[hidden]> wrote:
> 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.

Interesting. Overloading on operator= as we did with operator() is the
first thing it comes to my mind.

I tried to hide the indices (that are really only implementation
related) from the API using the constructor approach, but I think
yours is more flexible.

> int main()
> {
> overload<int(char ), double(int, char )> f;

Default class template parameters here ? ;-)

> f = &foo1; // no index needed
> f = &foo2; // the right assignment
> // is achieved by deducing
> // the argument signature

overloading overload::operator=() perhaps ?

> this is enough simple when the argument is a function pointer but can be
> more complex in other cases.

I'm really curious to see your code.


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