Splitter.opSlice(), ranges and const strings
Christopher Bergqvist
spambox0 at digitalpoetry.se
Wed Feb 23 22:41:53 PST 2011
Hi!
I've run into an issue which I don't understand.
Boiled down code:
import std.regex;
void main()
{
//string str = "sdf"; // works
//const string str = "sdf"; // doesn't work
immutable str = "sdf"; // doesn't work
auto pat = regex(", *");
auto split = splitter(str, pat);
}
Error:
/Library/Compilers/dmd2/osx/bin/../../src/phobos/std/regex.d(3022):
Error: this is not mutable
Should splitter() be able to cope with const/immutable ranges?
(That's with the latest official v2.052 dmd/phobos distribution for
mac. I got the same error before upgrading from the v2.051
also).
More information about the Digitalmars-d-learn
mailing list