On Saturday, 28 May 2016 at 11:57:09 UTC, Era Scarecrow wrote:
 Use traits..

https://dlang.org/phobos/std_traits.html#isSafe

so your function becomes (i believe)


    auto doSomethingDumb(T)(ref T t) if(isSafe!(T))

The problem is that T is a type, and I should check for safety of every method of T that I'm using in my function. This does not scale well, and if I change the body of the function to use a new method, I may forget to add it to the isSafe checks.

Reply via email to