On Saturday, 2 January 2016 at 02:03:13 UTC, Shriramana Sharma wrote:
Shriramana Sharma wrote:

Why is it impossible for a Regex object to be
`immutable`?

I find that I can't declare it as `const` either... This is most curious!

I think it's because regex() only compiles the regex at runtime so it needs to be modified later ; you'll find that using ctRegex() instead will allow you to declare it immutable for example. I didn't look at the implementation to identify a precise cause though.

Reply via email to