How do you debug @safe @nogc code? Can't figure out how to print.

Neia Neutuladh neia at ikeran.org
Sat Nov 17 17:48:43 UTC 2018


On Sat, 17 Nov 2018 13:55:24 +0000, aliak wrote:
> You can use "debug blah" to hide inside functions that are attributed,
> but when you have an attributed function that calls a template,
> attribtues of which are supposed to be inferred, it seems to fail.

You can explicitly mark a templated function as @nogc. If you want your 
function's @nogc-ness inferred, you can pull out the debug logging into a 
separate function and explicitly mark it @nogc.


More information about the Digitalmars-d-learn mailing list