On Friday, 7 August 2020 at 21:03:47 UTC, aberba wrote:
Syntactically they look the same (although D's can do more
things) so I'm trying to understand how why in D it's called
template but in languages like C#/Java they're generics.
I guess I have fair understanding of D's code generation but
On 2020-08-07 23:03, aberba wrote:
Syntactically they look the same (although D's can do more things) so
I'm trying to understand how why in D it's called template but in
languages like C#/Java they're generics.
I guess I have fair understanding of D's code generation but isn't it
same as wh
On 2020-08-07 23:39, H. S. Teoh wrote:
They are *very* different.
Java generics are based on "type erasure", i.e., at the syntactic level,
containers are parametrized with the element types, but at the
implementation level, the element types are merely "erased" and replaced
with Object (a top t
On Sat, Aug 08, 2020 at 01:47:27AM +, jmh530 via Digitalmars-d-learn wrote:
> On Friday, 7 August 2020 at 21:39:44 UTC, H. S. Teoh wrote:
> > [snip]
>
> "Furthermore, it can dispatch to a type-erased implementation ala Java
> -- at your choice;"
>
> This is interesting. Would you just cast to
On Friday, 7 August 2020 at 21:39:44 UTC, H. S. Teoh wrote:
[snip]
"Furthermore, it can dispatch to a type-erased implementation ala
Java -- at your choice;"
This is interesting. Would you just cast to Object?
On Friday, 7 August 2020 at 21:03:47 UTC, aberba wrote:
Syntactically they look the same (although D's can do more
things) so I'm trying to understand how why in D it's called
template but in languages like C#/Java they're generics.
In D, a copy of the function is created for each new template
On Fri, Aug 07, 2020 at 09:03:47PM +, aberba via Digitalmars-d-learn wrote:
> Syntactically they look the same (although D's can do more things) so
> I'm trying to understand how why in D it's called template but in
> languages like C#/Java they're generics.
>
> I guess I have fair understandi
Syntactically they look the same (although D's can do more
things) so I'm trying to understand how why in D it's called
template but in languages like C#/Java they're generics.
I guess I have fair understanding of D's code generation but
isn't it same as what what is available in those langua