Comment #0 by bearophile_hugs — 2014-07-24T11:27:55Z
It's not easy to iterate on a SList in a post-condition:
import std.container: SList;
auto foo()
out (result) {
foreach (x; result) {}
foreach (x; result[]) {}
} body {
SList!int sl;
return sl;
}
void main() {}
dmd 2.066beta4 gives:
test.d(4,5): Error: no property 'popFront' for type 'const(SList!int)'
test.d(4,5): Error: mutable method std.container.slist.SList!int.SList.front is not callable using a const object
test.d(5,23): Error: mutable method std.container.slist.SList!int.SList.opSlice is not callable using a const object
Comment #1 by robert.schadek — 2024-12-01T16:22:04Z