[Issue 20982] Add a pragma to suppress deprecation messages

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 27 12:15:44 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20982

Stanislav Blinov <stanislav.blinov at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stanislav.blinov at gmail.com

--- Comment #6 from Stanislav Blinov <stanislav.blinov at gmail.com> ---
(In reply to Andrei Alexandrescu from comment #2)
> Another idea from Stefan was to control this programmaticaly:
> 
> static if (deprecated(symbol)) {
>     ... avoid ...
> }

Yeah, we can kind of do this already, though it's a mouthful:

    static foreach (name; __traits(allMembers, Foo))
    {
        static if (!__traits(isDeprecated, __traits(getMember, Foo, name)))
        {{
            alias sym = __traits(getMember, Foo, name);
        }}
    }

--


More information about the Digitalmars-d-bugs mailing list