<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 12, 2016, at 7:12 AM, Zachary Turner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Ahh, UDLs also wouldn't permit non literal format strings, which is a deal breaker imo<br class=""></div></blockquote><div><br class=""></div><div>Why?</div><div>Somehow the goal pursued by Pavel (which you didn’t object per-se) is to provide *compile* time checking.</div><div>This imply that you cannot decouple the construction of the format and the argument list.</div><div><br class=""></div><div>— </div><div>Mehdi</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote"><div dir="ltr" class="">On Wed, Oct 12, 2016 at 7:03 AM Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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?<br class="gmail_msg"><br class="gmail_msg">"{0} {1}"_fs(1, 2)<br class="gmail_msg"><br class="gmail_msg">Could perhaps work, but it looks a little strange to me.<br class="gmail_msg"><br class="gmail_msg">Fwiw i agree format_string is long.  Ideally it would be called format, but that's taken.<br class="gmail_msg"><br class="gmail_msg">Another option is os.format("{0}", 7), and have format_string("{0}", 7) return a std::string.<br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Wed, Oct 12, 2016 at 6:43 AM Aaron Ballman <<a href="mailto:aaron@aaronballman.com" class="gmail_msg" target="_blank">aaron@aaronballman.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">>> 1. os << format_string("Test");   // writes "test"<br class="gmail_msg">
>> 2. os << format_string("{0}", 7);  // writes "7"<br class="gmail_msg">
><br class="gmail_msg">
><br class="gmail_msg">
> The "<< format_string(..." is ... really verbose for me. It also makes me<br class="gmail_msg">
> strongly feel like this produces a string rather than a streamable entity.<br class="gmail_msg">
<br class="gmail_msg">
I wonder if we could use UDLs instead?<br class="gmail_msg">
<br class="gmail_msg">
os << "Test" << "{0}"_fs << 7;<br class="gmail_msg">
<br class="gmail_msg">
~Aaron<br class="gmail_msg">
<br class="gmail_msg">
><br class="gmail_msg">
> I'm not a huge fan of streaming, but if we want to go this route, I'd very<br class="gmail_msg">
> much like to keep the syntax short and sweet. "format" is pretty great for<br class="gmail_msg">
> that. If this is going to fully subsume its use cases, can we eventually get<br class="gmail_msg">
> that to be the name?<br class="gmail_msg">
><br class="gmail_msg">
> (While I don't like streaming, I'm not trying to fight that battle here...)<br class="gmail_msg">
><br class="gmail_msg">
> Also, you should probably look at what is quickly becoming a popular C++<br class="gmail_msg">
> library in this space: <a href="https://github.com/fmtlib/fmt" rel="noreferrer" class="gmail_msg" target="_blank">https://github.com/fmtlib/fmt</a><br class="gmail_msg">
><br class="gmail_msg">
> _______________________________________________<br class="gmail_msg">
> LLVM Developers mailing list<br class="gmail_msg">
> <a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
><br class="gmail_msg">
</blockquote></div></blockquote></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></body></html>