SCHEDULED for deprecation
Denis Koroskin
2korden at gmail.com
Thu May 7 10:11:48 PDT 2009
On Thu, 07 May 2009 20:57:36 +0400, Tomasz <Sowiń> wrote:
> This phrase gave me an idea for a small feat:
>
> deprecated(2009-4-19) void foo();
>
> Compiling references to the deprecated declaration *before* the
> deprecation date would result in a *warning*.
> Compiling the deprecated declaration OR any reference to it *after* the
> date would result in an *error*.
>
> Advantages for maintanance are obvious, plus, the feature seems easy to
> implement. What do you think?
>
> Tomek
It should rather have an optional boolean condition (and a string message):
version = ReplacementIntroduced;
deprecated(ReplacementIntroduced, "Use foo2() instead") // optional message
void foo();
Here is another example:
deprecated(__DATE__ > toDate!("2008-04-19"))
void foo();
More information about the Digitalmars-d
mailing list