[Issue 8063] Purity of assert's second parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 8 04:10:52 PDT 2012


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


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc


--- Comment #1 from bearophile_hugs at eml.cc 2012-05-08 04:12:12 PDT ---
(In reply to comment #0)
> Calling impure functions in the second parameter of an assert statement within
> the body of a pure pure is an error, even in release mode.

This is good.


> Idem for static asserts.

For static arrays I think it will be OK to call impure functions in the message
part.



>     assert(value <= 10, text(value, " is greater than ", 10)); // Error: pure
> function 'foo' cannot call impure function 'text'

The solution is to have a pure text(), not to compromise on purity.

-- 
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