Boost logo

Boost :

Subject: Re: [boost] An analogue of boost.function with multiple signatures
From: Marco (mrcekets_at_[hidden])
Date: 2009-03-06 06:26:58


On Fri, 06 Mar 2009 01:35:14 +0100, Marco <mrcekets_at_[hidden]> wrote:

>
> Using my implementation you can get what you're interested in
> with the following code:
>
> struct doubler
> {
> template< typename T>
> T operator() (const T& x)
> {
> return x + x;
> }
> };
>
> boost::overload< std::string (std::string),
> float (float),
> unsigned (unsigned) > mf;
> mf.set(doubler);
> mf("ab");
> mf((UINT_MAX/2)+1);
> mf((UINT_MAX/2)+1.0);
>

Sorry mf.set(doubler) is wrong, clearly.

I mean:

doubler dbl;
mf.set(dbl);

- Marco Cecchetti

-- 
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