Boost logo

Boost :

From: Jonathan Wakely (cow_at_[hidden])
Date: 2004-11-18 10:46:34


On Thu, Nov 18, 2004 at 03:18:39PM +0000, Daniel James wrote:

> Jonathan Wakely wrote:
> >In fact, I get a similar error for the example code in your mail:
> >
> >overloaded.cc: In member function `ResultType
> >GENERATE_DETAIL::foo_overloaded_t<ResultType>::operator()() const':
> >overloaded.cc:7: error: no matching function for call to `foo()'
> >overloaded.cc:4: note: candidates are: void foo(int)
> >overloaded.cc:5: note: void foo(char*)
> >
> >So although I can see uses for this, I can't use it :-)
>
> Oh dear. I hadn't tested it very thoroughly - it works on g++ versions
> 2.95 and 3.3, but not 3.4 (which I guess you're using). I'm not sure

Yes, sorry, I should have said: GCC 3.4.3

> it's possible to deal with this on a compiler which implements two-phase
> template instantiation, since the nullary function isn't a template

Yeah, I had a look at the implementation but couldn't stop it being
compiled.

> function. It might be best just to remove it, since I don't think it's
> that useful anyway. Unless anyone's got a better idea.

That makes sense to me (and makes the tests compile :)

I suppose there might be cases where a model of Generator is overloaded
but it's unlikely to be the biggest use case.

Could you supply an extra arg to the macro, specifying whether to define
the nullary overload for the cases where it is wanted and valid ?

jon

-- 
I eat my peas with honey, I've done it all my life
It makes them taste quite funny, but it keeps them on the knife
	- The Orb

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk