class specialization for integral types

Charles Hixson charleshixsn at earthlink.net
Sat Sep 24 18:08:14 PDT 2011


On 09/24/2011 05:49 PM, Jonathan M Davis wrote:
> On Saturday, September 24, 2011 17:41:52 Charles Hixson wrote:
>> I spoke too soon.
>> class	AA(Key, Data)	if	(isNumeric (Key) )
>>    didn't work with a larger case,
>
> isNumeric!Key
>
> std.straits.isNumeric is an eponymous template, _not_ a function. I believe
> that everything in std.traits is an eponymous template, and pretty much
> anything that takes a type is going to be a template, and not a function. Look
> at the examples in std.traits, and you'll notice that they all use !.
>
> But essentially, it sounds like what you've been trying to do is failing,
> because you're treating the eponymous templates in std.traits as if they were
> functions.
>
> - Jonathan M Davis

Thank you.  That was, indeed, my problem.


More information about the Digitalmars-d-learn mailing list