search for: fmt_pad

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

Did you mean: fmt_id
2016 Oct 31
0
RFC: General purpose type-safe formatting library
...uot; outs() << "{0,x-}"_fmt.stream(0xDEADBEEF); "deadbeef" And many 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}"...
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