On Saturday, October 12, 2019 9:48:02 PM MDT jmh530 via Digitalmars-d-learn
wrote:
> On Saturday, 12 October 2019 at 21:44:57 UTC, Jonathan M Davis
>
> wrote:
> > [snip]
>
> Thanks for the reply.
>
> As with most people, I don't write a lot of D code that uses
> classes that much.
>
> The use case
On Saturday, 12 October 2019 at 21:44:57 UTC, Jonathan M Davis
wrote:
[snip]
Thanks for the reply.
As with most people, I don't write a lot of D code that uses
classes that much.
The use case I'm thinking of is with allocators, which - to be
honest - is not something I deal with much in m
On Saturday, October 12, 2019 2:11:28 PM MDT jmh530 via Digitalmars-d-learn
wrote:
> On Friday, 11 October 2019 at 17:50:42 UTC, Jonathan M Davis
>
> wrote:
> > [snip]
>
> A very thorough explanation!
>
> One follow-up question: would it be possible to mimic the
> behavior of Java generics in D?
On Friday, 11 October 2019 at 17:50:42 UTC, Jonathan M Davis
wrote:
[snip]
A very thorough explanation!
One follow-up question: would it be possible to mimic the
behavior of Java generics in D?
On Friday, 11 October 2019 at 17:50:42 UTC, Jonathan M Davis
wrote:
Generic functions and types operate on Object underneath the
hood. If you have Container and Container, you really
just have Container with some syntactic niceties to
avoid explicit casts. You get type checks to ensure that
Co
On Friday, October 11, 2019 12:09:20 PM MDT Just Dave via Digitalmars-d-
learn wrote:
> Thanks for the thorough explanation. Most of that is how I was
> thinking it worked. However, that leaves me perplexed. If
> templates just generate code then how come:
>
> Wouldnt..
>
> class SomeClass(T)
Thanks for the thorough explanation. Most of that is how I was
thinking it worked. However, that leaves me perplexed. If
templates just generate code then how come:
Wouldnt..
class SomeClass(T) : ISomeInterface!T
and..
class SomeOtherClass(T) : ISomeInterface!T
...generate two diffe
On Friday, October 11, 2019 8:43:49 AM MDT Just Dave via Digitalmars-d-learn
wrote:
> I come from both a C++ and C# background. Those have been the
> primary languages I have used. In C# you can do something like
> this:
>
> public interface ISomeInterface
> {
> T Value { get;
On Friday, 11 October 2019 at 14:43:49 UTC, Just Dave wrote:
I come from both a C++ and C# background. Those have been the
primary languages I have used.
Probably the D templates relate to C# generics the same way that
C++ templates do.