[Issue 4974] Cannot have pure constructor due to impure invariant

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 9 04:41:19 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4974



--- Comment #6 from bearophile_hugs at eml.cc 2010-11-09 04:40:16 PST ---
(In reply to comment #5)

> You should be able to do printf-style debugging in ANY pure function.

Do you mean something like this?

pure void foo() {
    debug { printf("foo"); }
}


And even giving the compiler an explicit debug{} tag that is tricky. In general
writing is a side effect. So if your programs output is the text it produces,
its output may change according to how much the compiler optimizes away pure
function calls.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list