.NET introduces Span<T>, basically D slices

Ola Fosheim Grostad ola.fosheim.grostad at gmail.com
Sun Nov 26 08:22:50 UTC 2017


On Sunday, 26 November 2017 at 05:36:15 UTC, Guy wrote:
> It's funny you say that because they just announced the 
> introduction of ranges and I believe they return Spans.

Well, basic dataflow pipelines with implicit transfer of buffer 
ownership. So it is a language feature with implicit RAII 
lifetime management, which is why Span is limited to the stack. 
Then they have a counterpart to Span called Memory that can be 
stored on th GC heap.

A reasonable tradeoff, but a general constraint would have been 
more interesting.


More information about the Digitalmars-d mailing list