http://d.puremagic.com/issues/show_bug.cgi?id=9665
--- Comment #6 from Maksim Zholudev <[email protected]> 2013-03-09 09:47:58 PST --- (In reply to comment #1) > But for non-mutable field, opAssign invocation is not legal, because it may > break const correctness. > > T* p; > struct T { > void opAssign(int n) { ...; p = &this; } > } > struct S { > immutable T field; > this(...) { field = 1; // invoke T.opAssign (currently not allowed) > /* now global p holds mutable pointer to immutable T object! */ > } > } Is there any way to break const correctness if opAssign is pure? If not, then changes should be allowed for pure opAssign (e.g. with implicit cast field to mutable). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
