Scope Containers

Atila Neves atila.neves at gmail.com
Mon Mar 11 20:04:45 UTC 2019


On Monday, 11 March 2019 at 19:23:19 UTC, H. S. Teoh wrote:
> On Mon, Mar 11, 2019 at 06:29:23PM +0000, Atila Neves via 
> Digitalmars-d wrote:
>> [...]
> [...]
>> [...]
> [...]
>
> Generally, it's a bad idea to conflate a container with a range 
> over the container, precisely for this reason. In this respect, 
> built-in arrays are a bad example, because we think of them as 
> containers, yet they are at the same time ranges. (Though 
> strictly speaking, "arrays" are just slices of the underlying 
> containers that are managed by druntime and not really directly 
> manipulatable. But nobody thinks of them in this way; the 
> concept of "array" is much easier to grasp and reason with than 
> "slice over druntime-managed container".)
>
> [...]

Maybe so. I'll have to think about it and maybe change the API so 
it's no longer a range.


More information about the Digitalmars-d mailing list