Inspecting __traits(isDeprecated) and deprecation warnings
Anonymouse
zorael at gmail.com
Thu Sep 26 15:09:44 UTC 2019
On Wednesday, 25 September 2019 at 20:35:55 UTC, 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
I think I can work with this, thanks!
More information about the Digitalmars-d-learn
mailing list