Shout out to D at cppcon, when talkign about ranges.

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 6 00:09:20 PDT 2015


On Tuesday, 6 October 2015 at 06:52:13 UTC, Ulrich Kuettler wrote:
> On Tuesday, 6 October 2015 at 02:31:53 UTC, Eric Niebler wrote:
>> Given that starting point, ranges of different strength are an 
>> "obvious" next step that many people thought up independently. 
>> D took it one way and C++ went another.
>>
>> When designing my range library, I looked at all the prior art 
>> available to me including D ranges and decided D's path was 
>> not the right one for C++.
>
> What is your thinking here? Did you write it down somewhere? 
> This would be very interesting.

Obviously, Eric would have to respond for us to know what his 
reasoning was, but I expect that it least part of it stems from 
the fact that C++ already uses iterators heavily. So, having a 
range-based solution that doesn't interact with iterators (like D 
has) doesn't fit in well with the existing code and paradigms. 
Even if you were to assume that D's approach is superior (which 
is debatable), that doesn't mean that it's a good fit for C++. D 
has the advantage of having considerably less baggage to deal 
with, so we have more freedom in the direction that we go. 
Whether we go in the right direction or not is another matter, 
but C++ has considerably more constraints than we have, so it's 
no surprise if we end up with different solutions.

- Jonathan M Davis


More information about the Digitalmars-d mailing list