On 9/25/19 11:35 PM, Boris Carvajal wrote:
On Wednesday, 25 September 2019 at 14:20:00 UTC, Anonymouse wrote:
I added some deprecations in my project and am going through my templates trying to silence the warnings that suddenly popped up. This template works, but it triggers deprecation warnings when I am actively trying to avoid them.

This code seems to work for classes too and even with DMD "-de" compiler switch.

template isMemberDeprecated(T, string name)
{
    enum isMemberDeprecated = mixin(q{__traits(isDeprecated, }, T, ".", name, q{)});
}

https://run.dlang.io/is/iQbxOC


It's really nice! Thank you.

Reply via email to