Proposed Enhancement: Deprecate std.conv.text With 0 Arguments

Jack Stouffer via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 22 09:47:53 PDT 2016


On Wednesday, 22 June 2016 at 15:48:06 UTC, Seb wrote:
> I don't see any problem in deprecating it as std.conv.text
> with 0 arguments is clearly unintended behavior

I don't see how you can make that claim, take a look at the code 
again:

private S textImpl(S, U...)(U args)
{
     static if (U.length == 0)
     {
         return null;
     }
     else
     {
         auto result = to!S(args[0]);
         foreach (arg; args[1 .. $])
             result ~= to!S(arg);
         return result;
     }
}

The zero argument result was clearly an intentional special case


More information about the Digitalmars-d mailing list