normal function and template function conflict

Ali Çehreli acehreli at yahoo.com
Thu Jul 26 11:21:17 PDT 2012


On 07/26/2012 11:14 AM, monarch_dodra wrote:
> On Thursday, 26 July 2012 at 17:57:31 UTC, Simen Kjaeraas wrote:
>> On Thu, 26 Jul 2012 19:18:21 +0200, monarch_dodra
>> <monarchdodra at gmail.com> wrote:
>>> 2) Is there a "correct" workaround?
>>
>> Exactly what you did. Though, for brevity, you would write this:
>>
>> void seed(T : UIntType)(T value = default_seed)
>
> Thanks
>
> I haven't seen this construct before. Can you tell me a bit more
> about it, or link me to some documentation about it?
>
> I suppose it means "T must be UIntType", but I'd enjoy having a broader
> understanding of it :)

Search for "specialization" in the following resources:

   http://dlang.org/template.html

 
https://github.com/PhilippeSigaud/D-templates-tutorial/blob/master/dtemplates.pdf

   http://ddili.org/ders/d.en/templates.html

Ali


More information about the Digitalmars-d-learn mailing list