Higher level built-in strings

Walter Bright newshound2 at digitalmars.com
Tue Jul 20 12:50:01 PDT 2010


Jérôme M. Berger wrote:
> Walter Bright wrote:
>> You can specialize the template for strings:
>>
>> void func(T:string)(T range) { ... }
> 
> 	Sure, i can also not use a template and write however many
> overloaded functions I need. So what are templates for?

The overloaded template specialization capability is exactly because it is often 
advantageous to write custom versions for certain types. The user of the 
template doesn't see that, it looks generic to him.


More information about the Digitalmars-d mailing list