Comparison chart of D and C++ templates
Chris Nicholson-Sauls
ibisbasenji at gmail.com
Fri Jan 19 17:24:12 PST 2007
Walter Bright wrote:
> Jarrett Billingsley wrote:
>> In the "Pointer parameters" row, you might also want to add
>> "delegates" to the D column, and make some mention of that ability in
>> the "Pointer to member parameters" row (i.e. "No, D doesn't have
>> pointers to parameters, it has delegates instead").
>
> Good call.
>
>> This table also makes some things clear that would be nice to have in
>> D. The ones that jump out at me are templated constructors and
>> overloading templated functions with other functions.
>
> Templated constructors, yes, but the overloading thing is unnecessary
> and makes things more complicated than needed.
Out of curiousity, what is it in particular that makes overloading of function templates
difficult/complicated? I have had occasions myself where it would've been highly welcome.
(Especially in the context of mixins, and especially as chains of more than three or
four static-if blocks can get mighty unwieldy. I have a project with a /recurring/ chain
of about seven static-if's. I'd be much happier with seven implementor's/mixin's that are
easier to maintain, and to add/remove.)
-- Chris Nicholson-Sauls
More information about the Digitalmars-d-announce
mailing list