Bug 18161 – std.algorithm.iteration.chunkBy should be usable in @safe

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2018-01-03T02:18:59Z
Last change time
2024-12-01T16:31:25Z
Assigned to
No Owner
Creator
Seb
Blocks
18110
Moved to GitHub: phobos#10278 →

Comments

Comment #0 by greensunny12 — 2018-01-03T02:18:59Z
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10278 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB