www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Splitter.opSlice(), ranges and const strings


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: 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
Feb 23 2011