Notes from C++ static analysis
Andrej Mitrovic
andrej.mitrovich at gmail.com
Thu Jun 27 06:16:24 PDT 2013
On 6/27/13, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
> On 6/27/13, Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote:
>> NO! This is exactly the kind of code that is buggy and useless. The
>> right use cases involve more arguments than format specifiers.
>
> I mistyped that, I meant:
>
> format("%s", 1, 2); // no exceptions in future release
> safeFormat("%s", 1, 2); // exception thrown
I'll add that the exception throwing was not introduced v2.000
(because my test-case was wrong), but was introduced in 2.062:
std.format.FormatException at C:\dmd-git\dmd2\windows\bin\..\..\src\phobos\std\string.d(2346):
Orphan format arguments: args[1..2]
I'd like to keep this behavior in either a new separate format
function or as a customization point of format.
More information about the Digitalmars-d
mailing list