search for: fmt_repeat

Displaying 2 results from an estimated 2 matches for "fmt_repeat".

2016 Oct 31
0
RFC: General purpose type-safe formatting library
...others 6) Adapters for specifying alignment, padding, and repetition with runtime values so you don't have to dynamically manipulate a format string. outs() << "{0}"_fmt.stream(fmt_pad(7, 3, 5)); " 7 "; outs() << "{0}{1}{2}"_fmt.stream(fmt_repeat("/\\", 3), 7, fmt_repeat("\\/", 3)); "/\/\/\7\/\/\/" 7) Compilation failures if the type cannot be formatted. struct Foo {}; outs() << "{0}"_fmt.stream(Foo{}); // compilation failure. 8) Extensible format provider mechanism to allow forma...
2016 Oct 14
2
RFC: General purpose type-safe formatting library
On 12.10.2016 05:59, Mehdi Amini via llvm-dev wrote: >> If you change a const char * to a StringRef, it can silently succeed >> while passing your StringRef object to printf. It should fail to compile! > > llvm::format now fails to compile as well :) > > However this does not address other issues, like: `format(ā€œ%dā€, float_var)` This may be a good time to point at