Dealing with Autodecode

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 1 08:24:04 PDT 2016


On Wednesday, 1 June 2016 at 01:36:43 UTC, Adam D. Ruppe wrote:
> version(string_migration)
> deprecated void popFront(T)(ref T t) if(isSomeString!T) {
>   static assert(0, "this is crap, fix your code.");
> }
> else
> deprecated("use -versionstring_migration to fix your buggy 
> code, would you like to know more?")
> /* existing popFront here */

version(autodecode_migration)
deprecated("autodecode attempted, use byDchar instead")
alias popFront=_d_popFront;
else
alias popFront=_d_popFront;

void _d_popFront(T)(ref T t) if(isSomeString!T) {
/* existing popFront here */
}

The migration branch should compile and work or template 
constraints will silently fail. Then deprecation messages can be 
grepped. That said does compiler print deprecation messages 
triggered inside template constraints?


More information about the Digitalmars-d mailing list