On Sun, 22 Mar 2015 18:44:47 +0000, Stefan Koch wrote: > On Sunday, 22 March 2015 at 18:24:31 UTC, ketmar wrote: > >> you can't do anything with `impure_function` anyway. > > Precisely my point! > a perfectly pure function is inferred impure because of dead code!
hm. i missed this part (about dead code). compiler doesn't do "dead nested function removal" before semantic analysis, afair, and attribute inference is in semantic stage. yet you can cheat compiler by turning `impure_function()` to template. attribute inference on templates are done when template is instantiated, and `impure_function()` is never instantiated.
signature.asc
Description: PGP signature
