digitalmars.D.bugs - [Issue 23231] New: splitWhen from std.algorithm is not CTFEable
- d-bugmail puremagic.com (23/23) Jul 06 2022 https://issues.dlang.org/show_bug.cgi?id=23231
https://issues.dlang.org/show_bug.cgi?id=23231 Issue ID: 23231 Summary: splitWhen from std.algorithm is not CTFEable Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: phobos Assignee: nobody puremagic.com Reporter: contact lsferreira.net 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. --
Jul 06 2022