import std.algorithm;
void test() @safe
{
auto data = [[1, 1], [1, 2], [2, 2], [2, 3]];
auto r1 = data.chunkBy!((a, b) => a[0] == b[0]);
}
Comment #1 by jack — 2018-03-07T20:56:30Z
This is due to chunkBy using RefCounted for its origin range, which I can't see any good reason to do.
Comment #2 by dlang-bot — 2021-08-25T18:58:55Z
@dukc created dlang/phobos pull request #8213 "Partially solve issue 18161 - splitWhen and most of chunkBy now @safe" mentioning this issue:
- Partially solve issue 18161. splitWhen and chunkBy when using forward ranges is now safe
https://github.com/dlang/phobos/pull/8213
Comment #3 by dlang-bot — 2021-08-31T06:10:14Z
dlang/phobos pull request #8213 "Partially solve issue 18161 - splitWhen and most of chunkBy now @safe" was merged into master:
- 41355cd4e397e462902b24ac033ace7faba6e33b by Ate Eskola:
Partially solve issue 18161. splitWhen and chunkBy when using forward ranges is now safe
https://github.com/dlang/phobos/pull/8213
Comment #4 by dlang-bot — 2021-09-30T10:19:14Z
@dukc created dlang/phobos pull request #8257 "Changelog entry went to wrong version" mentioning this issue:
- Partially solve issue 18161. splitWhen and chunkBy when using forward ranges is now safe
https://github.com/dlang/phobos/pull/8257
Comment #5 by robert.schadek — 2024-12-01T16:31:25Z