Notes from C++ static analysis

dennis luehring dl.soluz at gmx.net
Wed Jun 26 12:53:32 PDT 2013


Am 26.06.2013 21:33, schrieb Andrei Alexandrescu:
> On 6/26/13 11:08 AM, bearophile wrote:
>> On the other hand this D program prints just
>> "10" with no errors, ignoring the second x:
>>
>> import std.stdio;
>> void main() {
>> size_t x = 10;
>> writefln("%d", x, x);
>> }
>>
>> In a modern statically typed language I'd like such code to give a
>> compile-time error.
>
> Actually this is good because it allows to customize the format string
> to print only a subset of available information (I've actually used this).

why is there always a tiny need for such tricky stuff - isn't that only 
usefull in very rare cases


More information about the Digitalmars-d mailing list