Re: Difference between range `save` and copy constructor
uranuz via Digitalmars-d-learn Sun, 16 Feb 2020 06:10:48 -0800
In general for value-semantics and ref-semantics the different
code is actually needed. But generic algorithm try to pretend
that the logic is the same. But it's not true. But in wide subset
of trivial algorithm it's true. So it's incorrectly interpolated
that it's true for every case. The very bad thing if range is
passed by value it still can have value or reference semantic.
And algorithm cannot say which is it actually. There is not such
problemme for classes. So as I already said when passing ranges
by ref in algorithms they behave predictible. And if I want
algrorithm to operate on copy of algorithm then I can just create
this copy before passing it to this algorithm. And again
intention is more clear. But Phobos algorithms don't work like
that. It's why I can't use them in some cases, because they are
looking unpredictable for me.
- Difference between range `sav... uranuz via Digitalmars-d-learn
- Re: Difference between r... Steven Schveighoffer via Digitalmars-d-learn
- Re: Difference betwe... Jonathan M Davis via Digitalmars-d-learn
- Re: Difference betwe... Steven Schveighoffer via Digitalmars-d-learn
- Re: Difference betwe... uranuz via Digitalmars-d-learn
- Re: Difference betwe... uranuz via Digitalmars-d-learn
- Re: Difference betwe... uranuz via Digitalmars-d-learn
- Re: Difference b... Jonathan M Davis via Digitalmars-d-learn
- Re: Difference b... uranuz via Digitalmars-d-learn
- Re: Differen... Jonathan M Davis via Digitalmars-d-learn
- Re: Difference b... uranuz via Digitalmars-d-learn
- Re: Difference b... uranuz via Digitalmars-d-learn
- Re: Differen... Jonathan M Davis via Digitalmars-d-learn
- Re: Differen... Paul Backus via Digitalmars-d-learn
- Re: Dif... Jonathan M Davis via Digitalmars-d-learn
- Re: Dif... Paul Backus via Digitalmars-d-learn