May 10, 2016 [phobos] [dlang/phobos] ed03b2: Support multi-arg opApply/range for each. | ||||
---|---|---|---|---|
| ||||
Attachments:
| Branch: refs/heads/master Home: https://github.com/dlang/phobos Commit: ed03b22bc09046b274401d2ab4acfeb77147aa88 https://github.com/dlang/phobos/commit/ed03b22bc09046b274401d2ab4acfeb77147aa88 Author: Ryan Roden-Corrent <ryan@rcorre.net> Date: 2016-05-08 (Sun, 08 May 2016) Changed paths: M std/algorithm/iteration.d Log Message: ----------- Support multi-arg opApply/range for each. std.algorithm.iteration.each can now be called with a lambda taking >2 args. This should work for any input range that returns a tuple and any type with a non-templated opApply that takes a multi-arg delegate. Determining the arity of a templated opApply still poses a problem, so that case is not supported. This also adds support for `each` with two ref args. When given a binary function that takes two args by ref, std.algorithm.iteration.each should use both args by ref. It was previously discarding ref on the first arg, assuming it was for an index. Resolves #15358. Commit: 71ee3e530317ced9026f3ab0795edc1147be67f2 https://github.com/dlang/phobos/commit/71ee3e530317ced9026f3ab0795edc1147be67f2 Author: Dmitry Olshansky <dmitry.olsh@gmail.com> Date: 2016-05-10 (Tue, 10 May 2016) Changed paths: M std/algorithm/iteration.d Log Message: ----------- Merge pull request #3837 from rcorre/each_improved Improve std.algorithm.iteration.each Compare: https://github.com/dlang/phobos/compare/f257e8330e5b...71ee3e530317 |
Copyright © 1999-2021 by the D Language Foundation