Boost logo

Boost :

From: Jonathan H Lundquist (jhl_at_[hidden])
Date: 2001-08-28 10:38:39


>>> Why isn't the obvious syntax:
>>>
>>> template<>
>>> void f<int, long>(int, long)
>>>
>>>
>>> Because it fails to correctly identify
>>> which template is being specialised in all cases.
>>> For example:
>>>
>>> template<class U, class V>
>>> void f(U,V); //1
>>>
>>> template<class U, class V>
>>> void f(V,U); //2
>>
>> Thanks for expounding, but aren't the two above ambiguous anyway without
any
>> specializations?
>
> What do you mean 'the above two'?
> Do you mean a _call_?
>
> int i; string s;
> f<int,string>(i,s);
>
> Doesn't this call match 1, but not 2?

Yes that's what I mean. You've shown how to disambiguate them at the point
of call. Because they *must* be thusly disambiguated, in my view they are
'ambiguous'.
If they must be disambiguated at the point of call anyway, then if the
specialization syntax I was inquired about were legal, wouldn't it be
obvious which specialization was relevant?
Am I being dense? <g>.


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