I have been learning D over the past three weeks and I came to
the chapter in Programming in D on Ranges. And I am a little
confused on the choice to make Ranges based on the methods you
have in the struct, but not use a interface. With all of the
isInputRange!R you have to write everywhere,
On Friday, 26 June 2015 at 18:37:51 UTC, Jack Stouffer wrote:
The only reason I can think of to not do it this way is the
weird distinction between structs and classes in D.
If anything, C++ is the weird one in having two keywords that
mean the same thing...
But the reason comes down to
Thanks for the reply! I understand the reasoning now.
On Friday, 26 June 2015 at 18:46:03 UTC, Adam D. Ruppe wrote:
2) interfaces have an associated runtime cost, which ranges
wanted to avoid. They come with hidden function pointers and if
you actually use it through them, you can get a
On Friday, 26 June 2015 at 19:40:41 UTC, rsw0x wrote:
On Friday, 26 June 2015 at 19:26:57 UTC, Jack Stouffer wrote:
Thanks for the reply! I understand the reasoning now.
On Friday, 26 June 2015 at 18:46:03 UTC, Adam D. Ruppe wrote:
2) interfaces have an associated runtime cost, which ranges
On 06/26/2015 11:37 AM, Jack Stouffer wrote:
easier if the different types of Ranges where
just interfaces that you could inherit from.
If you think you need polymorphic interfaces, the next chapter talks
about inputRangeObject():
On Friday, 26 June 2015 at 19:26:57 UTC, Jack Stouffer wrote:
Thanks for the reply! I understand the reasoning now.
On Friday, 26 June 2015 at 18:46:03 UTC, Adam D. Ruppe wrote:
2) interfaces have an associated runtime cost, which ranges
wanted to avoid. They come with hidden function pointers
On Friday, 26 June 2015 at 19:26:57 UTC, Jack Stouffer wrote:
How much of a performance hit are we talking about? Is the
difference between using an interface and not using one
noticeable?
It can be huge difference if you take inlning in mind. LDC is
capable of flattening most simple
On Friday, 26 June 2015 at 18:37:51 UTC, Jack Stouffer wrote:
I have been learning D over the past three weeks and I came to
the chapter in Programming in D on Ranges. And I am a little
confused on the choice to make Ranges based on the methods you
have in the struct, but not use a interface.
On Fri, 26 Jun 2015 19:26:56 +, Jack Stouffer wrote:
Thanks for the reply! I understand the reasoning now.
On Friday, 26 June 2015 at 18:46:03 UTC, Adam D. Ruppe wrote:
2) interfaces have an associated runtime cost, which ranges wanted to
avoid. They come with hidden function pointers