Cooler
2014-01-02 11:23:38 UTC
Example:
const RedBlackTree!int rbt = redBlackTree(1, 2, 3);
foreach(i; rbt[])
writeln(i);
dmd 2.064 give me error
"mutable method
std.container.RedBlackTree!int.RedBlackTree.opSlice is not
callable using a const object"
Without "const" keyword the example compiled and works fine.
How can I iterate over const?
const RedBlackTree!int rbt = redBlackTree(1, 2, 3);
foreach(i; rbt[])
writeln(i);
dmd 2.064 give me error
"mutable method
std.container.RedBlackTree!int.RedBlackTree.opSlice is not
callable using a const object"
Without "const" keyword the example compiled and works fine.
How can I iterate over const?