IFTI, value types, and top-level const

Timon Gehr timon.gehr at gmx.ch
Sun Jun 9 16:31:03 PDT 2013


On 06/10/2013 12:56 AM, Jonathan M Davis wrote:
> On Sunday, June 09, 2013 16:36:45 Timon Gehr wrote:
>> On 06/09/2013 04:31 PM, Diggory wrote:
>>> Yeah, as long as it still prefers to match "const" during overload
>>> resolution then it's always possible to provide a const version when
>>> needed:
>>>
>>> void foo(T)(T x) {}
>>> void foo(T)(const T x) {}
>>>
>>> const int a = 1;
>>> foo(a);
>>>
>>> Clearly T should match "int" rather than "const(int)", and then the
>>> second overload called.
>>
>> Then clearly DMD is buggy.
>
> It's clearly as in that's the way that he thinks that it should clearly work,
> not as in that's how it's actually supposed to work.  ...

Yes, that's clear.



More information about the Digitalmars-d mailing list