Difference between range `save` and copy constructor

uranuz neuranuz at gmail.com
Sat Feb 15 10:53:01 UTC 2020


I am interested in current circumstances when we have new copy 
constructor feature what is the purpose of having range `save` 
primitive? For me they look like doing basicaly the same thing. 
And when looking in some source code of `range` module the most 
common thing that `save` does is that it use constructor 
typeof(this) to create a new instance and use `save` on the 
source range:
https://github.com/dlang/phobos/blob/v2.090.1/std/range/package.d

So what is conceptual difference between `save` and copy 
contructor of range?


More information about the Digitalmars-d-learn mailing list