digitalmars.D - Result of CTFE should be implicitly castable to immutable
- Dmitry Olshansky (7/7) Oct 11 2017 My motivation is, of course, std.regex.
- Steven Schveighoffer (5/14) Oct 11 2017 100% agree. Any CTFE'd result is implicitly unique. In fact CTFE
- Michael V. Franklin (4/11) Oct 11 2017 For whatever it's worth, I also agree.
My motivation is, of course, std.regex. static immutable r = regex("abc"); This is perfectly fine but because in general there is some amount of impurtiy in regex and it won't work. Yet regex is called at CTFE so there is no way it can escape mutable pointer to its result. Thoughts?
Oct 11 2017
On 10/11/17 10:30 AM, Dmitry Olshansky wrote:My motivation is, of course, std.regex. static immutable r = regex("abc"); This is perfectly fine but because in general there is some amount of impurtiy in regex and it won't work. Yet regex is called at CTFE so there is no way it can escape mutable pointer to its result. Thoughts?100% agree. Any CTFE'd result is implicitly unique. In fact CTFE annoyingly makes everything unique, even where it doesn't have to! Please file enhancement request if not already. -Steve
Oct 11 2017
On Wednesday, 11 October 2017 at 14:30:54 UTC, Dmitry Olshansky wrote:My motivation is, of course, std.regex. static immutable r = regex("abc"); This is perfectly fine but because in general there is some amount of impurtiy in regex and it won't work. Yet regex is called at CTFE so there is no way it can escape mutable pointer to its result. Thoughts?For whatever it's worth, I also agree. Mike
Oct 11 2017