search for: printrang

Displaying 3 results from an estimated 3 matches for "printrang".

Did you mean: printrange
2016 Oct 12
3
RFC: General purpose type-safe formatting library
I thought I did. :) Passing format strings between functions is very useful. For example, imagine wanting to write a function like printRange(const char *Fmt, std::vector<int> Items); This isn't possible if your format string MUST be a string literal and is very useful. Equally importantly, I don't see a good reason to disallow runtime format strings. On Wed, Oct 12, 2016 at 11:59 AM Mehdi Amini <mehdi.amini at apple...
2016 Oct 12
5
RFC: General purpose type-safe formatting library
...23 PM Mehdi Amini <mehdi.amini at apple.com> wrote: > On Oct 12, 2016, at 12:08 PM, Zachary Turner <zturner at google.com> wrote: > > I thought I did. :) Passing format strings between functions is very > useful. For example, imagine wanting to write a function like > printRange(const char *Fmt, std::vector<int> Items); > > > Iā€™m not sure I understand your example? > Do you mean you want the range to be in the format? If so Why? I would > rather write something like: > > printRange(ā€œ{per_elts_fmt}ā€, /* separator */ ā€œ, ", begin, end); > &...
2016 Oct 12
2
RFC: General purpose type-safe formatting library
I don't object to compile time checking *as long as it doesn't severely detract from brevity*. At the same time, I do object to *preventing* runtime format strings. When we have C++14, we can make every member of StringRef constexpr, and at that point we will get compile time checking mostly "for free" without preventing runtime format strings. For example, given a