class specialization for integral types

2011-09-24 Thread Charles Hixson
How would a specialize a parameterized class to only allow integral parameters (i.e., anything that would respond true to static if (is (T : long) ) (I'd have said static if (is (T : cent) ) or static if (is (T : ucent) ), but those are still marked reserved for future use.) I do want to

Re: class specialization for integral types

2011-09-24 Thread Jonathan M Davis
On Saturday, September 24, 2011 14:16:12 Charles Hixson wrote: How would a specialize a parameterized class to only allow integral parameters (i.e., anything that would respond true to static if (is (T : long) ) (I'd have said static if (is (T : cent) ) or static if (is (T : ucent) ), but

Re: class specialization for integral types

2011-09-24 Thread Charles Hixson
On 09/24/2011 02:33 PM, Jonathan M Davis wrote: On Saturday, September 24, 2011 14:16:12 Charles Hixson wrote: How would a specialize a parameterized class to only allow integral parameters (i.e., anything that would respond true to static if (is (T : long) ) (I'd have said static if (is (T :

Re: class specialization for integral types

2011-09-24 Thread Jonathan M Davis
On Saturday, September 24, 2011 16:14:48 Charles Hixson wrote: On 09/24/2011 02:33 PM, Jonathan M Davis wrote: On Saturday, September 24, 2011 14:16:12 Charles Hixson wrote: How would a specialize a parameterized class to only allow integral parameters (i.e., anything that would respond

Re: class specialization for integral types

2011-09-24 Thread Charles Hixson
On 09/24/2011 04:31 PM, Jonathan M Davis wrote: On Saturday, September 24, 2011 16:14:48 Charles Hixson wrote: On 09/24/2011 02:33 PM, Jonathan M Davis wrote: On Saturday, September 24, 2011 14:16:12 Charles Hixson wrote: How would a specialize a parameterized class to only allow integral

Re: class specialization for integral types

2011-09-24 Thread Jonathan M Davis
On Saturday, September 24, 2011 17:30:36 Charles Hixson wrote: OK, here's the problem: s$ dmd -unittest test2.d /usr/include/d/dmd/phobos/std/traits.d(2576): Error: template std.traits.isNumeric(T) is not a function template test2.d(8): Error: template std.traits.isNumeric(T) cannot deduce

Re: class specialization for integral types

2011-09-24 Thread Charles Hixson
I spoke too soon. class AA(Key, Data) if (isNumeric (Key) ) didn't work with a larger case, s$ dmd aa.d /usr/include/d/dmd/phobos/std/traits.d(2576): Error: template std.traits.isNumeric(T) is not a function template aa.d(200): Error: template std.traits.isNumeric(T) cannot deduce

Re: class specialization for integral types

2011-09-24 Thread Jonathan M Davis
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

Re: class specialization for integral types

2011-09-24 Thread Charles Hixson
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