digitalmars.D - Why both isSafe and isUnsafe?
- Andrei Alexandrescu (8/8) Sep 27 2020 https://dlang.org/phobos/std_traits.html#isSafe
- Steven Schveighoffer (7/18) Sep 27 2020 They were both added in one PR. 10 years ago.
https://dlang.org/phobos/std_traits.html#isSafe https://dlang.org/phobos/std_traits.html#isUnsafe Implementation: template isUnsafe(alias func) { enum isUnsafe = !isSafe!func; } Why do we need both?
Sep 27 2020
On 9/27/20 11:00 PM, Andrei Alexandrescu wrote:https://dlang.org/phobos/std_traits.html#isSafe https://dlang.org/phobos/std_traits.html#isUnsafe Implementation: template isUnsafe(alias func) { enum isUnsafe = !isSafe!func; } Why do we need both?They were both added in one PR. 10 years ago. Probably don't need both. But just undocument the second, and leave it. It's not a harm to leave it in and then it won't break code. Can also now be shrunk to a short form: enum isUnsafe(alias func) = !isSafe!func; -Steve
Sep 27 2020