Displaying 6 results from an estimated 6 matches for "_fs".
Did you mean:
_f
2016 Oct 12
2
RFC: General purpose type-safe formatting library
...writes "7"
>
>
> The "<< format_string(..." is ... really verbose for me. It also makes me
> strongly feel like this produces a string rather than a streamable entity.
I wonder if we could use UDLs instead?
os << "Test" << "{0}"_fs << 7;
~Aaron
>
> I'm not a huge fan of streaming, but if we want to go this route, I'd very
> much like to keep the syntax short and sweet. "format" is pretty great for
> that. If this is going to fully subsume its use cases, can we eventually get
> that to...
2016 Oct 12
2
RFC: General purpose type-safe formatting library
...o
On Wed, Oct 12, 2016 at 7:03 AM Zachary Turner <zturner at google.com> wrote:
> I'm not sure that would work well. The implementation relies on being able
> to index into the parameter pack. How would you do that if each parameter
> is streamed in?
>
> "{0} {1}"_fs(1, 2)
>
> Could perhaps work, but it looks a little strange to me.
>
> Fwiw i agree format_string is long. Ideally it would be called format, but
> that's taken.
>
> Another option is os.format("{0}", 7), and have format_string("{0}", 7)
> return a st...
2016 Oct 12
2
RFC: General purpose type-safe formatting library
...Wed, Oct 12, 2016 at 7:03 AM Zachary Turner <zturner at google.com> wrote:
>
> I'm not sure that would work well. The implementation relies on being able
> to index into the parameter pack. How would you do that if each parameter
> is streamed in?
>
> "{0} {1}"_fs(1, 2)
>
> Could perhaps work, but it looks a little strange to me.
>
> Fwiw i agree format_string is long. Ideally it would be called format, but
> that's taken.
>
> Another option is os.format("{0}", 7), and have format_string("{0}", 7)
> return a st...
2016 Oct 12
3
RFC: General purpose type-safe formatting library
...Wed, Oct 12, 2016 at 7:03 AM Zachary Turner <zturner at google.com> wrote:
>
> I'm not sure that would work well. The implementation relies on being able
> to index into the parameter pack. How would you do that if each parameter
> is streamed in?
>
> "{0} {1}"_fs(1, 2)
>
> Could perhaps work, but it looks a little strange to me.
>
> Fwiw i agree format_string is long. Ideally it would be called format, but
> that's taken.
>
> Another option is os.format("{0}", 7), and have format_string("{0}", 7)
> return a st...
2016 Oct 12
5
RFC: General purpose type-safe formatting library
...Wed, Oct 12, 2016 at 7:03 AM Zachary Turner <zturner at google.com> wrote:
>
> I'm not sure that would work well. The implementation relies on being able
> to index into the parameter pack. How would you do that if each parameter
> is streamed in?
>
> "{0} {1}"_fs(1, 2)
>
> Could perhaps work, but it looks a little strange to me.
>
> Fwiw i agree format_string is long. Ideally it would be called format, but
> that's taken.
>
> Another option is os.format("{0}", 7), and have format_string("{0}", 7)
> return a st...
2016 Oct 12
15
RFC: General purpose type-safe formatting library
A while back llvm::format() was introduced that made it possible to combine
printf-style formatting with llvm streams. However, this still comes with
all the risks and pitfalls of printf. Everyone is no-doubt familiar with
these problems, but here are just a few anyway:
1. *Not type-safe.* Not all compilers warn when you mess up the format
specifier. And when you're writing your own