Bug 23231 – splitWhen from std.algorithm is not CTFEable

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-07-06T09:43:19Z
Last change time
2024-12-01T16:40:13Z
Assigned to
No Owner
Creator
Luís Ferreira
Moved to GitHub: phobos#10496 →

Comments

Comment #0 by contact — 2022-07-06T09:43:19Z
The following example should compile: ``` import std.algorithm.comparison : equal; import std.range : dropExactly; immutable source = [4, 3, 2, 11, 0, -3, -3, 5, 3, 0]; enum result1 = source.splitWhen!((a,b) => a <= b); ``` It doesn't because ChunkBy implementation is used for splitWhen and swapping refcounter playloads are not supported due to a "fakePureCalloc" call.
Comment #1 by robert.schadek — 2024-12-01T16:40:13Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10496 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB