Documentation for std.range.put
(https://dlang.org/phobos/std_range_primitives.html#.put) has the
intriguing line:
put should not be used "UFCS-style", e.g. r.put(e). Doing this
may call R.put directly, by-passing any transformation feature
provided by Range.put. put(r, e) is prefered.
This raises the question of whether std.range.put is always
preferred over calling an output range's 'put' method, or if
there are times when calling an output range's 'put' method
directly is preferred. Also, it seems an easy oversight to
unintentionally call the wrong one.
Does anyone have recommendations or best practice suggestions for
which form to use and when?
--Jon
- std.range.put vs R.put: Best prac... Jon Degenhardt via Digitalmars-d-learn
-