www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13568] New: Support compile-time string formatting in


          Issue ID: 13568
           Summary: Support compile-time string formatting in std.format
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: hsteoh quickfur.ath.cx

Currently, std.format.formattedWrite (along with the convenience wrappers
around it, namely writef, writefln, std.string.format, etc.), take a runtime
format string as argument, although most use cases involve format strings that
are already known at compile-time. This limits what we can statically do with
these string, e.g., statically check that the right number of arguments are
being passed for that format, that the right types are being passed, etc.,
instead of deferring until runtime to detect any problems.

Ideally, we should extend formattedWrite() to accept compile-time strings so
that if the format is already statically known, we can perform compile-time
checks on it.

Oct 03 2014