Topic: [P0424] Reconsidering literal operator
Author: Richard Smith <richard@metafoo.co.uk>
Date: Mon, 15 Aug 2016 12:56:01 -0700
Raw View
--94eb2c0432162448ca053a219f3e
Content-Type: text/plain; charset=UTF-8
On Mon, Aug 15, 2016 at 10:09 AM, Louis Dionne <ldionne.2@gmail.com> wrote:
> On Sunday, 14 August 2016 22:22:16 UTC-7, Arthur O'Dwyer wrote:
>>
>> On Sunday, August 14, 2016 at 1:11:31 PM UTC-7, Louis Dionne wrote:
>>>
>>>
>>> In 2013, N3599 tried adding literal operator templates for strings:
>>>
>>> template <typename CharT, ChartT ...c>
>>> auto operator"" _user_defined_literal();
>>>
>>> Unfortunately, the paper was rejected at the time on the basis of
>>> lacking proper
>>> machinery for compile-time string processing. Motivated by several use
>>> cases
>>> requiring this literal operator (but no additional string processing
>>> machinery),
>>> I wrote a paper to try and revive this discussion with the committee.
>>>
>>> The latest draft of this paper is at [1]; please let me know of any
>>> comments.
>>> [1]: http://htmlpreview.github.io/?https://github.com/ldionne/wg2
>>> 1/blob/master/generated/P0424R0.html
>>>
>>
>> I'm wholly in favor of this idea, and the paper looks great. I would
>> love to see this in '17, even though I suspect it's missed the boat.
>>
>
> I'm targeting C++20.
>
You have my support :)
In C++17, I wonder whether the idea of template<typename CharT, CharT...
>> ch> operator""_udl is obsolete or archaic already. What if I've provided
>> a template<auto... ch> operator""_udl, is that good enough? (Obvious
>> literal answer: "no." But is there a good reason it shouldn't be? Bonus
>> points if the good reason is something other than
>> "compatibility/consistency with the C++11 version.")
>>
>
> I assume this could be made to work, but it might be slightly difficult to
> get the `CharT` type from just the `auto` parameter pack. We'd have to
> write a helper metafunction such as
>
> template <auto c, auto ...cs>
> struct type_of_first { using type = decltype(c); };
>
> Also, in case the parameter pack is empty (""_udl), we'd have no way to
> figure that type out.
>
>
>>
>>
>> Today I learned about htmlpreview.github.io, and it seems neat, but FYI,
>> it breaks your link to http://cplusplus.github.io/EWG/ewg-active.html#66
>> by turning it into a link to https://htmlpreview.github.io/
>> ?https://github.com/ldionne/wg21/blob/master/generated/P0424R0.html#66
>> . Therefore you would do better to "publish" this draft by adding it to
>> your gh-pages branch instead.
>>
>> (The htmlpreview bug is already filed: #43
>> <https://github.com/htmlpreview/htmlpreview.github.com/issues/43>.)
>>
>
> Thanks a lot. In any case, I rewrote the proposal in Latex due to other
> feedback I received. You can find it attached.
>
> Regards,
> Louis
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/67df98ef-c02d-484e-
> ac52-6a92c1b18778%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/67df98ef-c02d-484e-ac52-6a92c1b18778%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOfiQqmsjP63yW7VGO-Y%3DN44B3cGMWR8ouW27UPe6HoaFGHTsw%40mail.gmail.com.
--94eb2c0432162448ca053a219f3e
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On M=
on, Aug 15, 2016 at 10:09 AM, Louis Dionne <span dir=3D"ltr"><<a href=3D=
"mailto:ldionne.2@gmail.com" target=3D"_blank">ldionne.2@gmail.com</a>><=
/span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><span clas=
s=3D"">On Sunday, 14 August 2016 22:22:16 UTC-7, Arthur O'Dwyer wrote:=
<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;borde=
r-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Sunday, August =
14, 2016 at 1:11:31 PM UTC-7, Louis Dionne wrote:<blockquote class=3D"gmail=
_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div dir=3D"ltr"><div><div><div><br></div><div>In 2013, N3599=
tried adding literal operator templates for strings:</div><div><br></div><=
div>=C2=A0 template <typename CharT, ChartT ...c></div><div>=C2=A0 au=
to operator"" _user_defined_literal();</div><div><br></div><div>U=
nfortunately, the paper was rejected at the time on the basis of lacking pr=
oper</div><div>machinery for compile-time string processing. Motivated by s=
everal use cases</div><div>requiring this literal operator (but no addition=
al string processing machinery),</div><div>I wrote a paper to try and reviv=
e this discussion with the committee.</div><div><br></div><div>The latest d=
raft of this paper is at [1]; please let me know of any comments.</div><div=
>[1]: <a href=3D"http://htmlpreview.github.io/?https://github.com/ldionne/w=
g21/blob/master/generated/P0424R0.html" rel=3D"nofollow" target=3D"_blank">=
http://htmlpreview.github.io/?<wbr>https://github.com/ldionne/wg2<wbr>1/blo=
b/master/generated/P0424R<wbr>0.html</a></div></div></div></div></blockquot=
e><div><br></div><div>I'm wholly in favor of this idea, and the paper l=
ooks great.=C2=A0 I would love to see this in '17, even though I suspec=
t it's missed the boat.</div></div></blockquote><div><br></div></span><=
div>I'm targeting C++20. </div></div></blockquote><div><br></div><div>Y=
ou have my support :)</div><div><br></div><blockquote class=3D"gmail_quote"=
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><d=
iv dir=3D"ltr"><span class=3D""><blockquote class=3D"gmail_quote" style=3D"=
margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v dir=3D"ltr"><div></div><div>In C++17, I wonder whether the idea of <font =
face=3D"courier new, monospace">template<typename CharT, CharT... ch>=
operator""_udl</font> is obsolete or archaic already. What if I&=
#39;ve provided a <font face=3D"courier new, monospace">template<auto...=
ch> operator""_udl</font>, is that good enough? =C2=A0(Obviou=
s literal answer: "no." But is there a good reason it shouldn'=
;t be? Bonus points if the good reason is something other than "compat=
ibility/consistency with the C++11 version.")</div></div></blockquote>=
<div><br></div></span><div>I assume this could be made to work, but it migh=
t be slightly difficult to get the `CharT` type from just the `auto` parame=
ter pack. We'd have to write a helper metafunction such as</div><div><b=
r></div><div>=C2=A0 template <auto c, auto ...cs></div><div>=C2=A0 st=
ruct type_of_first { using type =3D decltype(c); };</div><div><br></div><di=
v>Also, in case the parameter pack is empty (""_udl), we'd ha=
ve no way to figure that type out.</div><span class=3D""><div>=C2=A0</div><=
blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border=
-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><br></div><div=
><br></div><div>Today I learned about <a href=3D"http://htmlpreview.github.=
io" rel=3D"nofollow" target=3D"_blank">htmlpreview.github.io</a>, and it se=
ems neat, but FYI, it breaks your link to <a href=3D"http://cplusplus.githu=
b.io/EWG/ewg-active.html#66" rel=3D"nofollow" target=3D"_blank">http://cplu=
splus.github.io/EWG<wbr>/ewg-active.html#66</a> by turning it into a link t=
o <a href=3D"https://htmlpreview.github.io/?https://github.com/ldionne/wg21=
/blob/master/generated/P0424R0.html#66" rel=3D"nofollow" target=3D"_blank">=
https://htmlpreview.github.io/<wbr>?https://github.com/ldionne/wg<wbr>21/bl=
ob/master/generated/P0424<wbr>R0.html#66</a> .=C2=A0 Therefore you would do=
better to "publish" this draft by adding it to your gh-pages bra=
nch instead.</div><div><br></div><div>(The htmlpreview bug is already filed=
: <a href=3D"https://github.com/htmlpreview/htmlpreview.github.com/issues/4=
3" rel=3D"nofollow" target=3D"_blank">#43</a>.)</div></div></blockquote><di=
v><br></div></span><div>Thanks a lot. In any case, I rewrote the proposal i=
n Latex due to other feedback I received. You can find it attached.</div><d=
iv>=C2=A0</div><div>Regards,</div><div>Louis</div><div><br></div><div><br><=
/div></div><span class=3D"">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/67df98ef-c02d-484e-ac52-6a92c1b18778%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/67df=
98ef-c02d-484e-<wbr>ac52-6a92c1b18778%40isocpp.org</a><wbr>.<br>
</blockquote></div><br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAOfiQqmsjP63yW7VGO-Y%3DN44B3cGMWR8ou=
W27UPe6HoaFGHTsw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOfiQqmsjP63yW=
7VGO-Y%3DN44B3cGMWR8ouW27UPe6HoaFGHTsw%40mail.gmail.com</a>.<br />
--94eb2c0432162448ca053a219f3e--
.
Author: "D. B." <db0451@gmail.com>
Date: Thu, 18 Aug 2016 20:23:36 +0100
Raw View
--047d7bf0dbf0bfee2e053a5d84fc
Content-Type: text/plain; charset=UTF-8
FYI the generated PDF now lives at
https://github.com/ldionne/wg21/blob/master/generated/D0424R0.pdf
with sources available in the parent directory.
--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhEY_1iwgBmA9W1LT96UYpT7g8tKqBuV0GupxYXWUjUh%3DA%40mail.gmail.com.
--047d7bf0dbf0bfee2e053a5d84fc
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>FYI the generated PDF now lives at<br><a href=3D"http=
s://github.com/ldionne/wg21/blob/master/generated/D0424R0.pdf">https://gith=
ub.com/ldionne/wg21/blob/master/generated/D0424R0.pdf</a><br></div>with sou=
rces available in the parent directory.<br><br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CACGiwhEY_1iwgBmA9W1LT96UYpT7g8tKqBuV=
0GupxYXWUjUh%3DA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhEY_1iwgB=
mA9W1LT96UYpT7g8tKqBuV0GupxYXWUjUh%3DA%40mail.gmail.com</a>.<br />
--047d7bf0dbf0bfee2e053a5d84fc--
.
Author: Tom Honermann <tom@honermann.net>
Date: Sun, 21 Aug 2016 22:12:37 -0400
Raw View
This is a multi-part message in MIME format.
--------------2EBA67C18852A8E1D7CEE1B1
Content-Type: text/plain; charset=UTF-8; format=flowed
On 8/21/2016 6:27 PM, Louis Dionne wrote:
>
> You can find it attached or at
> https://github.com/ldionne/wg21/blob/master/generated/D0424R0.pdf
> <https://github.com/ldionne/wg21/blob/master/generated/D0424R0.pdf>.
I'm also in favor of this proposal. The lack of such facilities is also
discussed in P0244R1 in the Future Directions/Constexpr Support
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0244r1.html#future_constexpr>
section [1] should you like to reference it in your proposal.
Tom.
[1]:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0244r1.html#future_constexpr
--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/921fd401-a2e5-71cc-7643-c6be509a4655%40honermann.net.
--------------2EBA67C18852A8E1D7CEE1B1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
">
</head>
<body bgcolor=3D"#FFFFFF" text=3D"#000000">
<div class=3D"moz-cite-prefix">On 8/21/2016 6:27 PM, Louis Dionne
wrote:<br>
</div>
<blockquote
cite=3D"mid:7695d7d8-1ca6-446a-beff-39ec567e1bdd@isocpp.org"
type=3D"cite">
<div dir=3D"ltr"><br>
<div>You can find it attached or at=C2=A0<a moz-do-not-send=3D"true=
"
href=3D"https://github.com/ldionne/wg21/blob/master/generated/D=
0424R0.pdf"
target=3D"_blank" rel=3D"nofollow" style=3D"cursor: pointer;">h=
ttps://github.com/ldionne/<wbr>wg21/blob/master/generated/<wbr>D0424R0.pdf<=
/a>.</div>
</div>
</blockquote>
<br>
I'm also in favor of this proposal.=C2=A0 The lack of such facilities i=
s
also discussed in <a
href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0244r1.htm=
l#future_constexpr">P0244R1
in the Future Directions/Constexpr Support</a> section [1] should
you like to reference it in your proposal.<br>
<br>
Tom.<br>
<br>
[1]:
<a class=3D"moz-txt-link-freetext" href=3D"http://www.open-std.org/jtc1/sc2=
2/wg21/docs/papers/2016/p0244r1.html#future_constexpr">http://www.open-std.=
org/jtc1/sc22/wg21/docs/papers/2016/p0244r1.html#future_constexpr</a><br>
</body>
</html>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/921fd401-a2e5-71cc-7643-c6be509a4655%=
40honermann.net?utm_medium=3Demail&utm_source=3Dfooter">https://groups.goog=
le.com/a/isocpp.org/d/msgid/std-proposals/921fd401-a2e5-71cc-7643-c6be509a4=
655%40honermann.net</a>.<br />
--------------2EBA67C18852A8E1D7CEE1B1--
.