C++ or D?
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Wed Dec 30 19:51:07 UTC 2020
On Wednesday, 30 December 2020 at 19:24:19 UTC, sighoya wrote:
> In my eyes, adding proper support for opImplicitCoercion
> enables the reuse of interfaces as typeclasses, yielding more
> potential for idiomatic development than utilizing C++ concepts
> alone.
Not sure what you mean? A D interface is a dynamic runtime
feature?
>> Btw, did D ever get to add nested template parameters? I know
>> people asked for it a long time ago, but cannot remember if
>> that was resolved somehow?
>
> Oh, what's this? Did you mean true Higher Kinded Types (HKT)
>
> ```
> fun(R,S,T:R=>S)
> ```
Sort of, in C++ it would be something like this
template<template<typename> class OuterName>
void myfunction(OuterName<int> x){ stuff(); }
> That would be great, but they're simply arguing to use alias
> symbols instead. The downside with aliases is however a more
> restricted type inference:
That is clearly a type unification bug. An alias isn't an alias
if it interferes with type unification!
More information about the Digitalmars-d-learn
mailing list