Topic: P0117: Generic to_string/to_wstring functions


Author: Robert Kawulak <robert.kawulak@gmail.com>
Date: Thu, 1 Oct 2015 15:50:48 +0200
Raw View
This is a multi-part message in MIME format.

------=_NextPart_000_028F_01D0FC60.F232A650
Content-Type: text/plain; charset=UTF-8

Hi,



I've written the paper
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0117r0.html>
proposing addition of to_string/to_wstring function templates to the
Standard Library. The functions are a concise replacement of the familiar
ostringstream solution to get a string representation of an object and they
generalise the existing to_string/to_wstring functions.



I'm not attending the Kona meeting - would somebody who does be so kind to
present the paper to the Commitee in my name? If so, please let me know
privately.



Also, discussion about the proposal is welcome.



Best regards,

Robert

--

---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_NextPart_000_028F_01D0FC60.F232A650
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40"><head><meta http-equiv=3DContent-Type content=
=3D"text/html; charset=3Dus-ascii"><meta name=3DGenerator content=3D"Micros=
oft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
 {font-family:"Cambria Math";
 panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
 {font-family:Calibri;
 panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
 {margin:0cm;
 margin-bottom:.0001pt;
 font-size:11.0pt;
 font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
 {mso-style-priority:99;
 color:blue;
 text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
 {mso-style-priority:99;
 color:purple;
 text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
 {mso-style-priority:99;
 mso-style-link:"Plain Text Char";
 margin:0cm;
 margin-bottom:.0001pt;
 font-size:10.5pt;
 font-family:"Courier New";}
span.PlainTextChar
 {mso-style-name:"Plain Text Char";
 mso-style-priority:99;
 mso-style-link:"Plain Text";
 font-family:"Courier New";}
..MsoChpDefault
 {mso-style-type:export-only;}
@page WordSection1
 {size:612.0pt 792.0pt;
 margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
 {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DPL link=3Dblue vlink=
=3Dpurple><div class=3DWordSection1><p class=3DMsoPlainText><span lang=3DEN=
-GB>Hi,<o:p></o:p></span></p><p class=3DMsoPlainText><span lang=3DEN-GB><o:=
p>&nbsp;</o:p></span></p><p class=3DMsoPlainText><span lang=3DEN-GB>I've wr=
itten <a href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0=
117r0.html">the paper</a> proposing addition of to_string/to_wstring functi=
on templates to the Standard Library. The functions are a concise replaceme=
nt of the familiar ostringstream solution to get a string representation of=
 an object and they generalise the existing to_string/to_wstring functions.=
<o:p></o:p></span></p><p class=3DMsoPlainText><span lang=3DEN-GB><o:p>&nbsp=
;</o:p></span></p><p class=3DMsoPlainText><span lang=3DEN-GB>I'm not attend=
ing the Kona meeting &#8211; would somebody who does be so kind to present =
the paper to the Commitee in my name? If so, please let me know privately.<=
o:p></o:p></span></p><p class=3DMsoPlainText><span lang=3DEN-GB><o:p>&nbsp;=
</o:p></span></p><p class=3DMsoPlainText><span lang=3DEN-GB>Also, discussio=
n about the proposal is welcome.<o:p></o:p></span></p><p class=3DMsoPlainTe=
xt><span lang=3DEN-GB><o:p>&nbsp;</o:p></span></p><p class=3DMsoPlainText><=
span lang=3DEN-GB>Best regards,<o:p></o:p></span></p><p class=3DMsoPlainTex=
t><span lang=3DEN-GB>Robert<o:p></o:p></span></p></div></body></html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_NextPart_000_028F_01D0FC60.F232A650--


.


Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Thu, 1 Oct 2015 07:07:10 -0700 (PDT)
Raw View
------=_Part_185_617594175.1443708430744
Content-Type: multipart/alternative;
 boundary="----=_Part_186_1525088962.1443708430744"

------=_Part_186_1525088962.1443708430744
Content-Type: text/plain; charset=UTF-8

I would agree generally with your proposal that something like this should
exist in the standard.
Having said that I wonder if you would then also propose similar templated
functions for:

   - to_int
   - to_uint
   - to_long
   - ... (you get the idea)

Or would you consider these not as important?


Also I believe these are so trivial that most people could implement them
anyway. I would suggest maybe seeing if something like this would not be
better as part of the GSL?

--

---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_186_1525088962.1443708430744
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I would agree generally with your proposal that something =
like this should exist in the standard.<br>Having said that I wonder if you=
 would then also propose similar templated functions for:<br><ul><li>to_int=
</li><li>to_uint</li><li>to_long</li><li>... (you get the idea)</li></ul><p=
>Or would you consider these not as important?</p><p><br></p><p>Also I beli=
eve these are so trivial that most people could implement them anyway. I wo=
uld suggest maybe seeing if something like this would not be better as part=
 of the GSL?<br></p></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_186_1525088962.1443708430744--
------=_Part_185_617594175.1443708430744--

.


Author: Robert Kawulak <robert.kawulak@gmail.com>
Date: Thu, 1 Oct 2015 16:51:11 +0200
Raw View
Izzy Coding, 2015-10-01 16:07:10:
> Having said that I wonder if you would then also propose similar template=
d
> functions for:
> * to_int
> * to_uint
> * to_long
> * ... (you get the idea)
> Or would you consider these not as important?

There are already stol/stoul/stof/etc. functions in the Standard Library. A=
 generic interface for those would be useful too, but currently I've focuse=
d only on the object->string side.

> Also I believe these are so trivial that most people could implement them
> anyway. I would suggest maybe seeing if something like this would not be
> better as part of the GSL?

Standard Library is supposed to contain stuff that is broadly useful, even =
if trivial, so it doesn't have to be implemented again and again by everyon=
e on their own. GSL, on the other hand, seems to be narrowly focussed on to=
ols related to Core Guidelines, and I don't remember seeing anything like t=
o_string in the guidelines.

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.


Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Thu, 1 Oct 2015 09:55:26 -0700 (PDT)
Raw View
------=_Part_2382_77239858.1443718526684
Content-Type: multipart/alternative;
 boundary="----=_Part_2383_1808448930.1443718526684"

------=_Part_2383_1808448930.1443718526684
Content-Type: text/plain; charset=UTF-8

IMHO the standard library should contain things that are most likely to be
used by most developers. However not everyone needs to_string in the way
you are proposing.
Yes it is nice and generic, but what does it provide that I cant already do
myself easily?

I suggested the GSL as maybe it could be a nice utility function and might
be better as being a guideline for implementation.

If however you had proposed a to_string that would work on wstring and
vice-versa I would say it is a brilliant idea as long as you were to take
locale into account (however these sorts of things have been discussed and
rejected many times).

But as I said that is just my opinion after having the same arguments
previously on the exact same topic.
I am not against your proposal. I just don't currently see any major
benefit to this.

>
>

--

---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_2383_1808448930.1443718526684
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">IMHO the standard library should contain things that are m=
ost likely to be used by most developers. However not everyone needs to_str=
ing in the way you are proposing.<br>Yes it is nice and generic, but what d=
oes it provide that I cant already do myself easily?<br><br>I suggested the=
 GSL as maybe it could be a nice utility function and might be better as be=
ing a guideline for implementation.<br><br>If however you had proposed a to=
_string that would work on wstring and vice-versa I would say it is a brill=
iant idea as long as you were to take locale into account (however these so=
rts of things have been discussed and rejected many times).<br><br>But as I=
 said that is just my opinion after having the same arguments previously on=
 the exact same topic.<br>I am not against your proposal. I just don&#39;t =
currently see any major benefit to this.<br><blockquote class=3D"gmail_quot=
e" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;paddin=
g-left: 1ex;">
<br></blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_2383_1808448930.1443718526684--
------=_Part_2382_77239858.1443718526684--

.


Author: Alisdair Meredith <alisdairm@me.com>
Date: Thu, 01 Oct 2015 14:53:39 -0400
Raw View
--Apple-Mail-7B7E5D7B-2B10-41E4-9356-065C4A17F433
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I would be happy to champion this paper, as it effectively makes 'to_string=
' an ADL aspect that can be overloaded by users in their own namespace if t=
hey want something more efficient than the generic string stream implementa=
tion, much like we overload 'swap'.

I think text representation of arbitrary types is a niche, but a large and =
useful niche - for example we will often want this feature when testing our=
 own libraries so the we can write meaningful debug strings.

I can probably run up some standardese in time for the meeting as well, if =
the proposal is well received.

Sent from my iPhone

> On Oct 1, 2015, at 9:50 AM, Robert Kawulak <robert.kawulak@gmail.com> wro=
te:
>=20
> Hi,
> =20
> I've written the paper proposing addition of to_string/to_wstring functio=
n templates to the Standard Library. The functions are a concise replacemen=
t of the familiar ostringstream solution to get a string representation of =
an object and they generalise the existing to_string/to_wstring functions.
> =20
> I'm not attending the Kona meeting =E2=80=93 would somebody who does be s=
o kind to present the paper to the Commitee in my name? If so, please let m=
e know privately.
> =20
> Also, discussion about the proposal is welcome.
> =20
> Best regards,
> Robert
> --=20
>=20
> ---=20
> 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.
> Visit this group at http://groups.google.com/a/isocpp.org/group/std-propo=
sals/.

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--Apple-Mail-7B7E5D7B-2B10-41E4-9356-065C4A17F433
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=
=3Dutf-8"></head><body dir=3D"auto"><div>I would be happy to champion this =
paper, as it effectively makes 'to_string' an ADL aspect that can be overlo=
aded by users in their own namespace if they want something more efficient =
than the generic string stream implementation, much like we overload 'swap'=
..</div><div id=3D"AppleMailSignature"><br></div><div id=3D"AppleMailSignatu=
re">I think text representation of arbitrary types is a niche, but a large =
and useful niche - for example we will often want this feature when testing=
 our own libraries so the we can write meaningful debug strings.</div><div =
id=3D"AppleMailSignature"><br></div><div id=3D"AppleMailSignature">I can pr=
obably run up some standardese in time for the meeting as well, if the prop=
osal is well received.<br><br>Sent from my iPhone</div><div><br>On Oct 1, 2=
015, at 9:50 AM, Robert Kawulak &lt;<a href=3D"mailto:robert.kawulak@gmail.=
com">robert.kawulak@gmail.com</a>&gt; wrote:<br><br></div><blockquote type=
=3D"cite"><div><meta http-equiv=3D"Content-Type" content=3D"text/html; char=
set=3Dus-ascii"><meta name=3D"Generator" content=3D"Microsoft Word 12 (filt=
ered medium)"><style><!--
/* Font Definitions */
@font-face
 {font-family:"Cambria Math";
 panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
 {font-family:Calibri;
 panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
 {margin:0cm;
 margin-bottom:.0001pt;
 font-size:11.0pt;
 font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
 {mso-style-priority:99;
 color:blue;
 text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
 {mso-style-priority:99;
 color:purple;
 text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
 {mso-style-priority:99;
 mso-style-link:"Plain Text Char";
 margin:0cm;
 margin-bottom:.0001pt;
 font-size:10.5pt;
 font-family:"Courier New";}
span.PlainTextChar
 {mso-style-name:"Plain Text Char";
 mso-style-priority:99;
 mso-style-link:"Plain Text";
 font-family:"Courier New";}
..MsoChpDefault
 {mso-style-type:export-only;}
@page WordSection1
 {size:612.0pt 792.0pt;
 margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
 {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--><div class=3D"WordSection1"><p class=3D"M=
soPlainText"><span lang=3D"EN-GB">Hi,<o:p></o:p></span></p><p class=3D"MsoP=
lainText"><span lang=3D"EN-GB"><o:p>&nbsp;</o:p></span></p><p class=3D"MsoP=
lainText"><span lang=3D"EN-GB">I've written <a href=3D"http://www.open-std.=
org/jtc1/sc22/wg21/docs/papers/2015/p0117r0.html">the paper</a> proposing a=
ddition of to_string/to_wstring function templates to the Standard Library.=
 The functions are a concise replacement of the familiar ostringstream solu=
tion to get a string representation of an object and they generalise the ex=
isting to_string/to_wstring functions.<o:p></o:p></span></p><p class=3D"Mso=
PlainText"><span lang=3D"EN-GB"><o:p>&nbsp;</o:p></span></p><p class=3D"Mso=
PlainText"><span lang=3D"EN-GB">I'm not attending the Kona meeting =E2=80=
=93 would somebody who does be so kind to present the paper to the Commitee=
 in my name? If so, please let me know privately.<o:p></o:p></span></p><p c=
lass=3D"MsoPlainText"><span lang=3D"EN-GB"><o:p>&nbsp;</o:p></span></p><p c=
lass=3D"MsoPlainText"><span lang=3D"EN-GB">Also, discussion about the propo=
sal is welcome.<o:p></o:p></span></p><p class=3D"MsoPlainText"><span lang=
=3D"EN-GB"><o:p>&nbsp;</o:p></span></p><p class=3D"MsoPlainText"><span lang=
=3D"EN-GB">Best regards,<o:p></o:p></span></p><p class=3D"MsoPlainText"><sp=
an lang=3D"EN-GB">Robert<o:p></o:p></span></p></div>

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br>
</div></blockquote></body></html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail-7B7E5D7B-2B10-41E4-9356-065C4A17F433--

.


Author: Tony V E <tvaneerd@gmail.com>
Date: Thu, 1 Oct 2015 17:18:26 -0400
Raw View
--001a113fb8c085a3d205211196d9
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, Oct 1, 2015 at 2:53 PM, Alisdair Meredith <alisdairm@me.com> wrote:

> I would be happy to champion this paper, as it effectively makes
> 'to_string' an ADL aspect that can be overloaded by users in their own
> namespace if they want something more efficient than the generic string
> stream implementation, much like we overload 'swap'.
>

If I need to do something similar to the "using std swap dance", I'll
probably vote against it.
We really need a better STL extension mechanism.  I'd even be happy with
the somewhat ugly std::to_string(x) calls std_to_string(x) with the latter
being the one you overload (but never call directly - only the STL would
call typically).

I find this analogous to Herb's Non-Virtual Interface guidance (
http://www.gotw.ca/publications/mill18.htm) of making virtual functions (ie
extension points) private, and making the user-facing interface non-virtual=
..

(Yes, I know, why don't I write a proposal then...)


>
> I think text representation of arbitrary types is a niche, but a large an=
d
> useful niche - for example we will often want this feature when testing o=
ur
> own libraries so the we can write meaningful debug strings.
>

Love or hate (likely hate here) Java, but it basically has it built in, and
people in the java world find it very useful.  Particularly for debugging.
I think it is worthy of standardization.  (And if you hate java, replace
with Python, etc)

I almost think there should be two versions - for debugging and for user
display (which gets complicated - locales, etc).

Or if this is just (mostly) for debugging, maybe it should be named
something more specific (to_debugstring, etc).  Or to_string<debug> or
to_string(obj, context =3D debug) or ...



>
> I can probably run up some standardese in time for the meeting as well, i=
f
> the proposal is well received.
>
> Sent from my iPhone
>
> On Oct 1, 2015, at 9:50 AM, Robert Kawulak <robert.kawulak@gmail.com>
> wrote:
>
> Hi,
>
>
>
> I've written the paper
> <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0117r0.html>
> proposing addition of to_string/to_wstring function templates to the
> Standard Library. The functions are a concise replacement of the familiar
> ostringstream solution to get a string representation of an object and th=
ey
> generalise the existing to_string/to_wstring functions.
>
>
>
> I'm not attending the Kona meeting =E2=80=93 would somebody who does be s=
o kind to
> present the paper to the Commitee in my name? If so, please let me know
> privately.
>
>
>
> Also, discussion about the proposal is welcome.
>
>
>
> Best regards,
>
> Robert
>
> --
>
> ---
> 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.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>
> --
>
> ---
> 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.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--001a113fb8c085a3d205211196d9
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Thu, Oct 1, 2015 at 2:53 PM, Alisdair Meredith <span dir=3D"ltr">&lt=
;<a href=3D"mailto:alisdairm@me.com" target=3D"_blank">alisdairm@me.com</a>=
&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px=
 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><di=
v dir=3D"auto"><div>I would be happy to champion this paper, as it effectiv=
ely makes &#39;to_string&#39; an ADL aspect that can be overloaded by users=
 in their own namespace if they want something more efficient than the gene=
ric string stream implementation, much like we overload &#39;swap&#39;.</di=
v></div></blockquote><div><br></div><div>If I need to do something similar =
to the &quot;using std swap dance&quot;, I&#39;ll probably vote against it.=
<br></div><div>We really need a better STL extension mechanism.=C2=A0 I&#39=
;d even be happy with the somewhat ugly std::to_string(x) calls std_to_stri=
ng(x) with the latter being the one you overload (but never call directly -=
 only the STL would call typically).<br></div><div><br></div><div>I find th=
is analogous to Herb&#39;s Non-Virtual Interface guidance (<a href=3D"http:=
//www.gotw.ca/publications/mill18.htm">http://www.gotw.ca/publications/mill=
18.htm</a>) of making virtual functions (ie extension points) private, and =
making the user-facing interface non-virtual.<br></div><div><br>(Yes, I kno=
w, why don&#39;t I write a proposal then...)<br>=C2=A0</div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid =
rgb(204,204,204);padding-left:1ex"><div dir=3D"auto"><div><br></div><div>I =
think text representation of arbitrary types is a niche, but a large and us=
eful niche - for example we will often want this feature when testing our o=
wn libraries so the we can write meaningful debug strings.</div></div></blo=
ckquote><div><br></div><div>Love or hate (likely hate here) Java, but it ba=
sically has it built in, and people in the java world find it very useful.=
=C2=A0 Particularly for debugging.<br></div><div>I think it is worthy of st=
andardization.=C2=A0 (And if you hate java, replace with Python, etc)<br></=
div><div><br></div><div>I almost think there should be two versions - for d=
ebugging and for user display (which gets complicated - locales, etc).<br><=
br></div><div>Or if this is just (mostly) for debugging, maybe it should be=
 named something more specific (to_debugstring, etc).=C2=A0 Or to_string&lt=
;debug&gt; or to_string(obj, context =3D debug) or ...<br><br></div><div>=
=C2=A0<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=
=3D"auto"><div><br></div><div>I can probably run up some standardese in tim=
e for the meeting as well, if the proposal is well received.<br><br>Sent fr=
om my iPhone</div><div><div class=3D"h5"><div><br>On Oct 1, 2015, at 9:50 A=
M, Robert Kawulak &lt;<a href=3D"mailto:robert.kawulak@gmail.com" target=3D=
"_blank">robert.kawulak@gmail.com</a>&gt; wrote:<br><br></div><blockquote t=
ype=3D"cite"><div><div><p><span lang=3D"EN-GB">Hi,<u></u><u></u></span></p>=
<p><span lang=3D"EN-GB"><u></u>=C2=A0<u></u></span></p><p><span lang=3D"EN-=
GB">I&#39;ve written <a href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs=
/papers/2015/p0117r0.html" target=3D"_blank">the paper</a> proposing additi=
on of to_string/to_wstring function templates to the Standard Library. The =
functions are a concise replacement of the familiar ostringstream solution =
to get a string representation of an object and they generalise the existin=
g to_string/to_wstring functions.<u></u><u></u></span></p><p><span lang=3D"=
EN-GB"><u></u>=C2=A0<u></u></span></p><p><span lang=3D"EN-GB">I&#39;m not a=
ttending the Kona meeting =E2=80=93 would somebody who does be so kind to p=
resent the paper to the Commitee in my name? If so, please let me know priv=
ately.<u></u><u></u></span></p><p><span lang=3D"EN-GB"><u></u>=C2=A0<u></u>=
</span></p><p><span lang=3D"EN-GB">Also, discussion about the proposal is w=
elcome.<u></u><u></u></span></p><p><span lang=3D"EN-GB"><u></u>=C2=A0<u></u=
></span></p><p><span lang=3D"EN-GB">Best regards,<u></u><u></u></span></p><=
p><span lang=3D"EN-GB">Robert<u></u><u></u></span></p></div>

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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@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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></blockquote></div></div></div><div class=3D""><div class=3D"h5">

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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@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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a113fb8c085a3d205211196d9--

.


Author: Matthew Fioravante <fmatthew5876@gmail.com>
Date: Thu, 1 Oct 2015 16:10:54 -0700 (PDT)
Raw View
------=_Part_70_506417427.1443741054702
Content-Type: multipart/alternative;
 boundary="----=_Part_71_1052656078.1443741054702"

------=_Part_71_1052656078.1443741054702
Content-Type: text/plain; charset=UTF-8


On Thursday, October 1, 2015 at 5:18:29 PM UTC-4, Tony V E wrote:
>
>
> If I need to do something similar to the "using std swap dance", I'll
> probably vote against it.
> We really need a better STL extension mechanism.  I'd even be happy with
> the somewhat ugly std::to_string(x) calls std_to_string(x) with the latter
> being the one you overload (but never call directly - only the STL would
> call typically).
>
> I find this analogous to Herb's Non-Virtual Interface guidance (
> http://www.gotw.ca/publications/mill18.htm) of making virtual functions
> (ie extension points) private, and making the user-facing interface
> non-virtual.
>

I ranted about this in another thread and completely agree with you.
Requiring "using std::XYZ" to use extension point XYZ() is insanity.

- It pollutes the your scope with the symbol where maybe you only wanted it
for that one call.
- Its very easy to forget to do or not understand why you need to do
it. (C++ expert only gotcha). I remember Andrei Alexandrescu's talk about
scope guard he had to remind the audience to say using std::swap in his
swap operator. If someone like him has to remind us how to correctly call
swap() we have a problem. God forbid a newbie asks why, then you get to
teach him how ADL works.
- You can never use the extension point in a one line expression. This
means you can't use it in decltype (unless you do some hacks with detail::
namespaces) and therefore you can't easily use the extension points to
define concepts, trailing return types, etc..
- Very verbose, extra boilerplate, and ugly. Most people (myself included)
will still just call "v.begin();" instead of the technically more correct
"using std::begin; begin(v);".

We are getting more and more of these (swap, begin, end, cbegin, cend,
size, data, to_string, ...). A proper interface for these extension points
should be decided on before we go too far down this rabbit hole.

Possible solutions:
- std::name() trys ADL name() first, then member name(), then either a
default action (e.g. swap uses moves) or compiler error if there is no
default.
- std::name() is the public interface, and you write an ADL std_name()
(ignore bikeshedding for now) which std::name() calls. Tony's idea if I
understood him correctly.
- Add overload of name() to the global namespace for built-in types.
Probably a non-starter, but it can make ADL work without a using clause.

The uniform call syntax proposal is nice but it does not address the "using
std::swap" problem.


--

---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_71_1052656078.1443741054702
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br>On Thursday, October 1, 2015 at 5:18:29 PM UTC-4, Tony V E wrote:<block=
quote style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-co=
lor: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;"=
 class=3D"gmail_quote"><div dir=3D"ltr"><div><div class=3D"gmail_quote"><di=
v>=C2=A0</div><div>If I need to do something similar to the &quot;using std=
 swap dance&quot;, I&#39;ll probably vote against it.<br></div><div>We real=
ly need a better STL extension mechanism.=C2=A0 I&#39;d even be happy with =
the somewhat ugly std::to_string(x) calls std_to_string(x) with the latter =
being the one you overload (but never call directly - only the STL would ca=
ll typically).<br></div><div><br></div><div>I find this analogous to Herb&#=
39;s Non-Virtual Interface guidance (<a onmousedown=3D"this.href=3D&#39;htt=
p://www.google.com/url?q\75http%3A%2F%2Fwww.gotw.ca%2Fpublications%2Fmill18=
..htm\46sa\75D\46sntz\0751\46usg\75AFQjCNHoTPlDZ_kgvEt6oS6D6fN3ANeWuA&#39;;r=
eturn true;" onclick=3D"this.href=3D&#39;http://www.google.com/url?q\75http=
%3A%2F%2Fwww.gotw.ca%2Fpublications%2Fmill18.htm\46sa\75D\46sntz\0751\46usg=
\75AFQjCNHoTPlDZ_kgvEt6oS6D6fN3ANeWuA&#39;;return true;" href=3D"http://www=
..gotw.ca/publications/mill18.htm" rel=3D"nofollow" target=3D"_blank">http:/=
/www.gotw.ca/<wbr>publications/mill18.htm</a>) of making virtual functions =
(ie extension points) private, and making the user-facing interface non-vir=
tual.<br></div></div></div></div></blockquote><div>=C2=A0</div><div>I rante=
d about=C2=A0this=C2=A0in another thread and completely agree with you. Req=
uiring &quot;using=C2=A0std::XYZ&quot; to use extension point=C2=A0XYZ() is=
=C2=A0insanity.</div><div>=C2=A0</div><div>- It pollutes the your=C2=A0scop=
e with the symbol where maybe you only wanted it for that one call.</div><d=
iv>- Its very easy to forget to do or not understand why you=C2=A0need to d=
o it.=C2=A0(C++ expert only gotcha). I remember Andrei Alexandrescu&#39;s t=
alk about scope guard he had to remind the audience to say using std::swap =
in his swap operator. If someone like him has to remind us how to correctly=
 call swap() we have a problem. God forbid a newbie asks why, then you get =
to teach him how ADL works.</div><div>- You can never use the extension poi=
nt in a one line expression. This means you can&#39;t use it in decltype (u=
nless you do some hacks with detail:: namespaces) and therefore you can&#39=
;t easily=C2=A0use the extension points to define concepts, trailing return=
 types, etc..</div><div>- Very verbose,=C2=A0extra boilerplate,=C2=A0and ug=
ly. Most people (myself included) will still just call &quot;v.begin();&quo=
t; instead of the technically more correct &quot;using std::begin; begin(v)=
;&quot;.</div><div>=C2=A0</div><div>We are getting more and more of these (=
swap, begin, end, cbegin, cend, size, data, to_string, ...).=C2=A0A proper=
=C2=A0interface for these extension points should be decided on before we g=
o too far down this rabbit hole.</div><div>=C2=A0</div><div>Possible soluti=
ons:</div><div>- std::name() trys ADL name() first, then member name(), the=
n either a default action (e.g. swap uses moves) or compiler error if there=
 is no default.</div><div>- std::name() is the public interface, and you wr=
ite an ADL std_name() (ignore bikeshedding for now) which std::name() calls=
.. Tony&#39;s idea if I understood him correctly.</div><div>- Add overload o=
f name() to the global namespace for built-in types. Probably a non-starter=
, but it can make ADL work without a using clause.</div><div>=C2=A0</div><d=
iv>The uniform call syntax proposal is nice but it does not address the &qu=
ot;using std::swap&quot; problem.</div><div>=C2=A0</div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_71_1052656078.1443741054702--
------=_Part_70_506417427.1443741054702--

.


Author: Sam Kellett <samkellett@gmail.com>
Date: Fri, 2 Oct 2015 07:53:13 +0100
Raw View
--001a1141015c0c8ddd0521199e3d
Content-Type: text/plain; charset=UTF-8

On 2 October 2015 at 00:10, Matthew Fioravante <fmatthew5876@gmail.com>
wrote:

>
> On Thursday, October 1, 2015 at 5:18:29 PM UTC-4, Tony V E wrote:
>>
>>
>> If I need to do something similar to the "using std swap dance", I'll
>> probably vote against it.
>> We really need a better STL extension mechanism.  I'd even be happy with
>> the somewhat ugly std::to_string(x) calls std_to_string(x) with the latter
>> being the one you overload (but never call directly - only the STL would
>> call typically).
>>
>> I find this analogous to Herb's Non-Virtual Interface guidance (
>> http://www.gotw.ca/publications/mill18.htm) of making virtual functions
>> (ie extension points) private, and making the user-facing interface
>> non-virtual.
>>
>
> I ranted about this in another thread and completely agree with you.
> Requiring "using std::XYZ" to use extension point XYZ() is insanity.
>
> - It pollutes the your scope with the symbol where maybe you only wanted
> it for that one call.
> - Its very easy to forget to do or not understand why you need to do
> it. (C++ expert only gotcha). I remember Andrei Alexandrescu's talk about
> scope guard he had to remind the audience to say using std::swap in his
> swap operator. If someone like him has to remind us how to correctly call
> swap() we have a problem. God forbid a newbie asks why, then you get to
> teach him how ADL works.
> - You can never use the extension point in a one line expression. This
> means you can't use it in decltype (unless you do some hacks with detail::
> namespaces) and therefore you can't easily use the extension points to
> define concepts, trailing return types, etc..
> - Very verbose, extra boilerplate, and ugly. Most people (myself included)
> will still just call "v.begin();" instead of the technically more correct
> "using std::begin; begin(v);".
>
> We are getting more and more of these (swap, begin, end, cbegin, cend,
> size, data, to_string, ...). A proper interface for these extension points
> should be decided on before we go too far down this rabbit hole.
>
> Possible solutions:
> - std::name() trys ADL name() first, then member name(), then either a
> default action (e.g. swap uses moves) or compiler error if there is no
> default.
> - std::name() is the public interface, and you write an ADL std_name()
> (ignore bikeshedding for now) which std::name() calls. Tony's idea if I
> understood him correctly.
> - Add overload of name() to the global namespace for built-in types.
> Probably a non-starter, but it can make ADL work without a using clause.
>
> The uniform call syntax proposal is nice but it does not address the
> "using std::swap" problem.
>

agree completely with everything. this sucks so bad.

what about a new namespace that we are allowed to override (and create our
own customization points)?

adl::swap()

or even:

std::adl::swap()

to avoid breaking changes.

it gets called fully qualified by the user and then compiler magic will do
the adl dance from the namespace it was called in.

--

---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--001a1141015c0c8ddd0521199e3d
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On 2 October 2015 at 00:10, Matthew Fioravante <span dir=3D"ltr">&lt;<a=
 href=3D"mailto:fmatthew5876@gmail.com" target=3D"_blank">fmatthew5876@gmai=
l.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=
=3D""><br>On Thursday, October 1, 2015 at 5:18:29 PM UTC-4, Tony V E wrote:=
<blockquote style=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-=
color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class=
=3D"gmail_quote"><div dir=3D"ltr"><div><div class=3D"gmail_quote"><div>=C2=
=A0</div><div>If I need to do something similar to the &quot;using std swap=
 dance&quot;, I&#39;ll probably vote against it.<br></div><div>We really ne=
ed a better STL extension mechanism.=C2=A0 I&#39;d even be happy with the s=
omewhat ugly std::to_string(x) calls std_to_string(x) with the latter being=
 the one you overload (but never call directly - only the STL would call ty=
pically).<br></div><div><br></div><div>I find this analogous to Herb&#39;s =
Non-Virtual Interface guidance (<a href=3D"http://www.gotw.ca/publications/=
mill18.htm" rel=3D"nofollow" target=3D"_blank">http://www.gotw.ca/publicati=
ons/mill18.htm</a>) of making virtual functions (ie extension points) priva=
te, and making the user-facing interface non-virtual.<br></div></div></div>=
</div></blockquote><div>=C2=A0</div></span><div>I ranted about=C2=A0this=C2=
=A0in another thread and completely agree with you. Requiring &quot;using=
=C2=A0std::XYZ&quot; to use extension point=C2=A0XYZ() is=C2=A0insanity.</d=
iv><div>=C2=A0</div><div>- It pollutes the your=C2=A0scope with the symbol =
where maybe you only wanted it for that one call.</div><div>- Its very easy=
 to forget to do or not understand why you=C2=A0need to do it.=C2=A0(C++ ex=
pert only gotcha). I remember Andrei Alexandrescu&#39;s talk about scope gu=
ard he had to remind the audience to say using std::swap in his swap operat=
or. If someone like him has to remind us how to correctly call swap() we ha=
ve a problem. God forbid a newbie asks why, then you get to teach him how A=
DL works.</div><div>- You can never use the extension point in a one line e=
xpression. This means you can&#39;t use it in decltype (unless you do some =
hacks with detail:: namespaces) and therefore you can&#39;t easily=C2=A0use=
 the extension points to define concepts, trailing return types, etc..</div=
><div>- Very verbose,=C2=A0extra boilerplate,=C2=A0and ugly. Most people (m=
yself included) will still just call &quot;v.begin();&quot; instead of the =
technically more correct &quot;using std::begin; begin(v);&quot;.</div><div=
>=C2=A0</div><div>We are getting more and more of these (swap, begin, end, =
cbegin, cend, size, data, to_string, ...).=C2=A0A proper=C2=A0interface for=
 these extension points should be decided on before we go too far down this=
 rabbit hole.</div><div>=C2=A0</div><div>Possible solutions:</div><div>- st=
d::name() trys ADL name() first, then member name(), then either a default =
action (e.g. swap uses moves) or compiler error if there is no default.</di=
v><div>- std::name() is the public interface, and you write an ADL std_name=
() (ignore bikeshedding for now) which std::name() calls. Tony&#39;s idea i=
f I understood him correctly.</div><div>- Add overload of name() to the glo=
bal namespace for built-in types. Probably a non-starter, but it can make A=
DL work without a using clause.</div><div>=C2=A0</div><div>The uniform call=
 syntax proposal is nice but it does not address the &quot;using std::swap&=
quot; problem.</div></blockquote><div><br></div><div>agree completely with =
everything. this sucks so bad.<br><br></div><div>what about a new namespace=
 that we are allowed to override (and create our own customization points)?=
<br><br></div><div>adl::swap()<br><br></div><div>or even:<br><br></div><div=
>std::adl::swap()<br><br></div><div>to avoid breaking changes.<br><br></div=
><div>it gets called fully qualified by the user and then compiler magic wi=
ll do the adl dance from the namespace it was called in.<br></div></div></d=
iv></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a1141015c0c8ddd0521199e3d--

.


Author: David Krauss <potswa@gmail.com>
Date: Fri, 2 Oct 2015 15:37:49 +0800
Raw View
--Apple-Mail=_F912299A-8BBA-48D5-8D28-DA8B8660B07B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9310=E2=80=9302, at 2:53 PM, Sam Kellett <samkellett@gmail.=
com> wrote:
>=20
> agree completely with everything. this sucks so bad.
>=20
> what about a new namespace that we are allowed to override (and create ou=
r own customization points)?
>=20
> adl::swap()

Such a namespace name would be an oxymoron.

> or even:
>=20
> std::adl::swap()

How about simply =E2=80=9Cstd::swap=E2=80=9D and let it do the work of pull=
ing in ADL?

> to avoid breaking changes.

Question for all: Must qualified std::swap be supported as an accessor to t=
he three-move algorithm, e.g. for ADL overloads that add side-effects but n=
ot optimization?

Perhaps it would be a good idea, going forward, to forbid ADL hooks from ca=
lling their std:: counterparts, so that std may encapsulate ADL.

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--Apple-Mail=_F912299A-8BBA-48D5-8D28-DA8B8660B07B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9310=
=E2=80=9302, at 2:53 PM, Sam Kellett &lt;<a href=3D"mailto:samkellett@gmail=
..com" class=3D"">samkellett@gmail.com</a>&gt; wrote:</div><br class=3D"Appl=
e-interchange-newline"><div class=3D""><div dir=3D"ltr" style=3D"font-famil=
y: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; fo=
nt-weight: normal; letter-spacing: normal; line-height: normal; orphans: au=
to; text-align: start; text-indent: 0px; text-transform: none; white-space:=
 normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D""><div class=3D"gmail_extra">agree completely with everything. thi=
s sucks so bad.<br class=3D""><div class=3D"gmail_quote"><div class=3D""><b=
r class=3D""></div><div class=3D"">what about a new namespace that we are a=
llowed to override (and create our own customization points)?<br class=3D""=
><br class=3D""></div><div class=3D"">adl::swap()<br class=3D""></div></div=
></div></div></div></blockquote><div><br class=3D""></div><div>Such a names=
pace name would be an oxymoron.</div><br class=3D""><blockquote type=3D"cit=
e" class=3D""><div class=3D""><div dir=3D"ltr" style=3D"font-family: Helvet=
ica; font-size: 12px; font-style: normal; font-variant: normal; font-weight=
: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-=
align: start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D"=
"><div class=3D"gmail_extra"><div class=3D"gmail_quote"><div class=3D"">or =
even:<br class=3D""><br class=3D""></div><div class=3D"">std::adl::swap()<b=
r class=3D""></div></div></div></div></div></blockquote><div><br class=3D""=
></div><div>How about simply =E2=80=9C<font face=3D"Courier" class=3D"">std=
::swap</font>=E2=80=9D and let it do the work of pulling in ADL?</div><br c=
lass=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div dir=3D"=
ltr" style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; line-hei=
ght: normal; orphans: auto; text-align: start; text-indent: 0px; text-trans=
form: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-t=
ext-stroke-width: 0px;" class=3D""><div class=3D"gmail_extra"><div class=3D=
"gmail_quote"><div class=3D"">to avoid breaking changes.<br class=3D""></di=
v></div></div></div></div></blockquote><div><br class=3D""></div><div>Quest=
ion for all: Must qualified&nbsp;<font face=3D"Courier" class=3D"">std::swa=
p</font>&nbsp;be supported as an accessor to the three-move algorithm, e.g.=
 for ADL overloads that add side-effects but not optimization?</div></div><=
div><br class=3D""></div><div>Perhaps it would be a good idea, going forwar=
d, to forbid ADL hooks from calling their <font face=3D"Courier" class=3D""=
>std::</font> counterparts, so that <font face=3D"Courier" class=3D"">std</=
font> may encapsulate ADL.</div><div><br class=3D""></div></body></html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_F912299A-8BBA-48D5-8D28-DA8B8660B07B--

.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Fri, 2 Oct 2015 10:49:51 +0300
Raw View
On 2 October 2015 at 10:37, David Krauss <potswa@gmail.com> wrote:
> std::adl::swap()
>
> How about simply =E2=80=9Cstd::swap=E2=80=9D and let it do the work of pu=
lling in ADL?
> to avoid breaking changes.

I have seen ruminations about a std::adl_swap that pulls in ADL.

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.


Author: David Krauss <potswa@gmail.com>
Date: Fri, 2 Oct 2015 15:58:31 +0800
Raw View
--Apple-Mail=_F97B0291-05E0-4505-B2A8-CF2147E5798A
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9310=E2=80=9302, at 3:49 PM, Ville Voutilainen <ville.vouti=
lainen@gmail.com> wrote:
>=20
> I have seen ruminations about a std::adl_swap that pulls in ADL.

Me too, but I=E2=80=99ve not seen any speculation about simply fixing std::=
swap. I=E2=80=99m not sure if this is because implementing such a fix is tr=
ickier than adl_swap, or because it could lead to infinite recursion in cor=
ner cases. Hence asking whether the corner case is significant.

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--Apple-Mail=_F97B0291-05E0-4505-B2A8-CF2147E5798A
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9310=
=E2=80=9302, at 3:49 PM, Ville Voutilainen &lt;<a href=3D"mailto:ville.vout=
ilainen@gmail.com" class=3D"">ville.voutilainen@gmail.com</a>&gt; wrote:</d=
iv><br class=3D"Apple-interchange-newline"><div class=3D"">I have seen rumi=
nations about a std::adl_swap that pulls in ADL.<br class=3D""></div></bloc=
kquote></div><br class=3D""><div class=3D"">Me too, but I=E2=80=99ve not se=
en any speculation about simply fixing <font face=3D"Courier" class=3D"">st=
d::swap</font>. I=E2=80=99m not sure if this is because implementing such a=
 fix is trickier than <font face=3D"Courier" class=3D"">adl_swap</font>, or=
 because it could lead to infinite recursion in corner cases. Hence asking =
whether the corner case is significant.</div><div class=3D""><br class=3D""=
></div></body></html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_F97B0291-05E0-4505-B2A8-CF2147E5798A--

.


Author: Sam Kellett <samkellett@gmail.com>
Date: Fri, 2 Oct 2015 09:07:07 +0100
Raw View
--001a11c346385ff88e05211aa6c8
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 2 October 2015 at 08:37, David Krauss <potswa@gmail.com> wrote:

>
> On 2015=E2=80=9310=E2=80=9302, at 2:53 PM, Sam Kellett <samkellett@gmail.=
com> wrote:
>
> agree completely with everything. this sucks so bad.
>
> what about a new namespace that we are allowed to override (and create ou=
r
> own customization points)?
>
> adl::swap()
>
>
> Such a namespace name would be an oxymoron.
>
> or even:
>
> std::adl::swap()
>
>
> How about simply =E2=80=9Cstd::swap=E2=80=9D and let it do the work of pu=
lling in ADL?
>

how would a user differentiate between a customization hook and something
that isn't (like the rest of the std:: namespace)?

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--001a11c346385ff88e05211aa6c8
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On 2 October 2015 at 08:37, David Krauss <span dir=3D"ltr">&lt;<a href=
=3D"mailto:potswa@gmail.com" target=3D"_blank">potswa@gmail.com</a>&gt;</sp=
an> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-=
word"><br><div><span class=3D""><blockquote type=3D"cite"><div>On 2015=E2=
=80=9310=E2=80=9302, at 2:53 PM, Sam Kellett &lt;<a href=3D"mailto:samkelle=
tt@gmail.com" target=3D"_blank">samkellett@gmail.com</a>&gt; wrote:</div><b=
r><div><div dir=3D"ltr" style=3D"font-family:Helvetica;font-size:12px;font-=
style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;l=
ine-height:normal;text-align:start;text-indent:0px;text-transform:none;whit=
e-space:normal;word-spacing:0px"><div class=3D"gmail_extra">agree completel=
y with everything. this sucks so bad.<br><div class=3D"gmail_quote"><div><b=
r></div><div>what about a new namespace that we are allowed to override (an=
d create our own customization points)?<br><br></div><div>adl::swap()<br></=
div></div></div></div></div></blockquote><div><br></div></span><div>Such a =
namespace name would be an oxymoron.</div><span class=3D""><br><blockquote =
type=3D"cite"><div><div dir=3D"ltr" style=3D"font-family:Helvetica;font-siz=
e:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spac=
ing:normal;line-height:normal;text-align:start;text-indent:0px;text-transfo=
rm:none;white-space:normal;word-spacing:0px"><div class=3D"gmail_extra"><di=
v class=3D"gmail_quote"><div>or even:<br><br></div><div>std::adl::swap()<br=
></div></div></div></div></div></blockquote><div><br></div></span><div>How =
about simply =E2=80=9C<font face=3D"Courier">std::swap</font>=E2=80=9D and =
let it do the work of pulling in ADL?=C2=A0<br></div></div></div></blockquo=
te><div><br></div><div>how would a user differentiate between a customizati=
on hook and something that isn&#39;t (like the rest of the std:: namespace)=
? <br></div></div><br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a11c346385ff88e05211aa6c8--

.


Author: David Krauss <potswa@gmail.com>
Date: Fri, 2 Oct 2015 16:12:58 +0800
Raw View
--Apple-Mail=_D9E32E29-E44E-472C-A2BD-826F481F65F2
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9310=E2=80=9302, at 4:07 PM, Sam Kellett <samkellett@gmail.=
com> wrote:
>=20
> how would a user differentiate between a customization hook and something=
 that isn't (like the rest of the std:: namespace)?=20

They wouldn=E2=80=99t. There would be no way to bypass a third-party librar=
y=E2=80=99s internal swap details, which sounds like a good thing.

It=E2=80=99s true, this would break libraries with bugs for which the worka=
round is to qualify std::swap. I=E2=80=99ll add to my question, is that bre=
akage significant, either?

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--Apple-Mail=_D9E32E29-E44E-472C-A2BD-826F481F65F2
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9310=
=E2=80=9302, at 4:07 PM, Sam Kellett &lt;<a href=3D"mailto:samkellett@gmail=
..com" class=3D"">samkellett@gmail.com</a>&gt; wrote:</div><br class=3D"Appl=
e-interchange-newline"><div class=3D""><div dir=3D"ltr" style=3D"font-famil=
y: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; fo=
nt-weight: normal; letter-spacing: normal; line-height: normal; orphans: au=
to; text-align: start; text-indent: 0px; text-transform: none; white-space:=
 normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D""><div class=3D"gmail_extra">how would a user differentiate betwee=
n a customization hook and something that isn't (like the rest of the std::=
 namespace)?&nbsp;</div></div></div></blockquote></div><br class=3D""><div =
class=3D"">They wouldn=E2=80=99t. There would be no way to bypass a third-p=
arty library=E2=80=99s internal <font face=3D"Courier" class=3D"">swap</fon=
t> details, which sounds like a good thing.</div><div class=3D""><br class=
=3D""></div><div class=3D"">It=E2=80=99s true, this would break libraries w=
ith bugs for which the workaround is to qualify <font face=3D"Courier" clas=
s=3D"">std::swap</font>. I=E2=80=99ll add to my question, is that breakage =
significant, either?</div><div class=3D""><br class=3D""></div></body></htm=
l>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_D9E32E29-E44E-472C-A2BD-826F481F65F2--

.


Author: Sam Kellett <samkellett@gmail.com>
Date: Fri, 2 Oct 2015 10:14:46 +0100
Raw View
--001a11c342ee4b90ae05211b98d3
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 2 October 2015 at 09:12, David Krauss <potswa@gmail.com> wrote:

>
> On 2015=E2=80=9310=E2=80=9302, at 4:07 PM, Sam Kellett <samkellett@gmail.=
com> wrote:
>
> how would a user differentiate between a customization hook and something
> that isn't (like the rest of the std:: namespace)?
>
>
> They wouldn=E2=80=99t. There would be no way to bypass a third-party libr=
ary=E2=80=99s
> internal swap details, which sounds like a good thing.
>
> It=E2=80=99s true, this would break libraries with bugs for which the wor=
karound
> is to qualify std::swap. I=E2=80=99ll add to my question, is that breakag=
e
> significant, either?
>

fair. is there any reason these hooks are adl-based instead of a
template-specialization ala std::hash? that method of customization seems
to have aged better (if not just w/r/t people's opinions of it) -- although
i'm sure there's things that adl provides that wouldn't be possible
otherwise?

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--001a11c342ee4b90ae05211b98d3
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On 2 October 2015 at 09:12, David Krauss <span dir=3D"ltr">&lt;<a href=
=3D"mailto:potswa@gmail.com" target=3D"_blank">potswa@gmail.com</a>&gt;</sp=
an> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-=
word"><span class=3D""><br><div><blockquote type=3D"cite"><div>On 2015=E2=
=80=9310=E2=80=9302, at 4:07 PM, Sam Kellett &lt;<a href=3D"mailto:samkelle=
tt@gmail.com" target=3D"_blank">samkellett@gmail.com</a>&gt; wrote:</div><b=
r><div><div dir=3D"ltr" style=3D"font-family:Helvetica;font-size:12px;font-=
style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;l=
ine-height:normal;text-align:start;text-indent:0px;text-transform:none;whit=
e-space:normal;word-spacing:0px"><div class=3D"gmail_extra">how would a use=
r differentiate between a customization hook and something that isn&#39;t (=
like the rest of the std:: namespace)?=C2=A0</div></div></div></blockquote>=
</div><br></span><div>They wouldn=E2=80=99t. There would be no way to bypas=
s a third-party library=E2=80=99s internal <font face=3D"Courier">swap</fon=
t> details, which sounds like a good thing.</div><div><br></div><div>It=E2=
=80=99s true, this would break libraries with bugs for which the workaround=
 is to qualify <font face=3D"Courier">std::swap</font>. I=E2=80=99ll add to=
 my question, is that breakage significant, either?</div></div></blockquote=
><div><br></div><div>fair. is there any reason these hooks are adl-based in=
stead of a template-specialization ala std::hash? that method of customizat=
ion seems to have aged better (if not just w/r/t people&#39;s opinions of i=
t) -- although i&#39;m sure there&#39;s things that adl provides that would=
n&#39;t be possible otherwise?<br></div></div></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a11c342ee4b90ae05211b98d3--

.


Author: Robert Kawulak <robert.kawulak@gmail.com>
Date: Fri, 2 Oct 2015 16:33:29 +0200
Raw View
2015-10-01 20:53 GMT+02:00, Alisdair Meredith:
> I would be happy to champion this paper, as it effectively makes 'to_string'
> an ADL aspect that can be overloaded by users in their own namespace if they
> want something more efficient than the generic string stream implementation,
> much like we overload 'swap'.

I'm not sure to_string would make a good customisation point to
override the default implementation that is proposed, because this
implementation already has a customisation point: the string insertion
operator. So custom to_string(T) would have to be required to yield
results identical to insertion of T to a stream with default flags,
otherwise it would be very surprising that the results are
inconsistent depending on how you use to_string, like when ("value: "
+ to_string(t)) != to_string("value: ", t).

> I think text representation of arbitrary types is a niche, but a large and
> useful niche - for example we will often want this feature when testing our
> own libraries so the we can write meaningful debug strings.

It's also useful in other cases because of its (isolated) formatting
and concatenation capabilities, and useful in general for applications
not dealing with localisation/internationalisation. Some more examples
apart from those found in the paper:

- reliably changing text colour of a terminal using ANSI escape code:
    cout << to_string("\x1b[", 30 + color, 'm');
If the escape sequence is not wrapped in to_string, it may be
corrupted by current formatting flags of stream (like hex or showpos).

- using C-style output interface for types supporting IO Streams interface:
    printf("the value is '%s'", to_string(value).c_str());

> I can probably run up some standardese in time for the meeting as well, if
> the proposal is well received.

Thanks, I already have something on the way, I need to polish it though.

--

---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Matthew Fioravante <fmatthew5876@gmail.com>
Date: Fri, 2 Oct 2015 09:58:21 -0700 (PDT)
Raw View
------=_Part_982_1385273883.1443805101950
Content-Type: multipart/alternative;
 boundary="----=_Part_983_1050831295.1443805101950"

------=_Part_983_1050831295.1443805101950
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Friday, October 2, 2015 at 3:37:55 AM UTC-4, David Krauss wrote:
>
>
> How about simply =E2=80=9Cstd::swap=E2=80=9D and let it do the work of pu=
lling in ADL?
>
> to avoid breaking changes.
>
>
That's probably the easiest backwards compatibility story. The old using=20
std::swap; swap() call has identical semantics to calling std::swap() with=
=20
the new rules.

Also we can't rely on ADL alone at the callsite because of built-in types.=
=20
That means a free function call will need to be namespace qualified. So=20
better to qualify it with std:: than anything else.

Writing a convention wrapper like stl_begin is boilerplate because I'll=20
still want a member named begin(). Requiring useless wrappers obscures and=
=20
adds complexity to the the code and also adds more maintenance burden.

I should be able to write a member swap() or a non-member ADL swap() and=20
expect calling std::swap() to just work. Same for begin(), size(), etc..=20
Make all of these things uniform and simple. I can also write a member=20
to_string() and std::to_string calls it for me.
The order should be ADL first, member second, and then default or error.

Also swap() really should be a part of the "The rule of 0 or 6". That is,=
=20
it should have =3Ddefault,=3Ddelete support just like copy and move operati=
ons.=20
Most of the time a perfectly optimal swap() just wants to swap() the=20
members. If you aren't defining copy and move operations almost surely the=
=20
=3Ddefault swap implementation is what you want. std::swap can't do this=20
because its impossible to write a template that calls swap() on all of the=
=20
private data members of a type. That's a different proposal though...
=20

> Question for all: Must qualified std::swap be supported as an accessor to=
=20
> the three-move algorithm, e.g. for ADL overloads that add side-effects bu=
t=20
> not optimization?
>

Allow implicit swap() =3D default; like I just mentioned above, and you don=
't=20
need this feature anymore.
=20

> Perhaps it would be a good idea, going forward, to forbid ADL hooks from=
=20
> calling their std:: counterparts, so that std may encapsulate ADL.
>

Sounds like a rule for the C++ guidelines project. A static analyzer can=20
probably pick up a lot of violations of this rule.=20

The big problem is if someone already calls std::swap from swap and=20
upgrades, their code will change to an infinite loop.

Alternatively swap() could be an operator >=3D< like some other proposals=
=20
have suggested. Then it can be overloaded in the global namespace for=20
builtin types just like operator=3D allow ADL to work correctly.

ADL is insufficient by itself for "named operators" like swap() and=20
begin(). ADL only works if the built-in types have overloads in the global=
=20
namespace, which fine for operator overloading but not really a good=20
practice for named functions.=20

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_983_1050831295.1443805101950
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Friday, October 2, 2015 at 3:37:55 AM UTC-4, Da=
vid Krauss wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div style=3D=
"word-wrap:break-word"><div><div><br></div><div>How about simply =E2=80=9C<=
font face=3D"Courier">std::swap</font>=E2=80=9D and let it do the work of p=
ulling in ADL?</div><br><blockquote type=3D"cite"><div><div dir=3D"ltr" sty=
le=3D"font-family:Helvetica;font-size:12px;font-style:normal;font-variant:n=
ormal;font-weight:normal;letter-spacing:normal;line-height:normal;text-alig=
n:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing=
:0px"><div><div class=3D"gmail_quote"><div>to avoid breaking changes.</div>=
</div></div></div></div></blockquote></div></div></blockquote><div><br></di=
v><div>That&#39;s probably the easiest backwards compatibility story. The o=
ld using std::swap; swap() call has identical semantics to calling std::swa=
p() with the new rules.</div><div><br></div><div>Also we can&#39;t rely on =
ADL alone at the callsite because of built-in types. That means a free func=
tion call will need to be namespace qualified. So better to qualify it with=
 std:: than anything else.</div><div><br></div><div>Writing a convention wr=
apper like stl_begin is boilerplate because I&#39;ll still want a member na=
med begin(). Requiring useless wrappers obscures and adds complexity to the=
 the code and also adds more maintenance burden.</div><div><br></div><div>I=
 should be able to write a member swap() or a non-member ADL swap() and exp=
ect calling std::swap() to just work. Same for begin(), size(), etc.. Make =
all of these things uniform and simple. I can also write a member to_string=
() and std::to_string calls it for me.</div><div>The order should be ADL fi=
rst, member second, and then default or error.</div><div><br></div><div>Als=
o swap() really should be a part of the &quot;The rule of 0 or 6&quot;. Tha=
t is, it should have =3Ddefault,=3Ddelete support just like copy and move o=
perations. Most of the time a perfectly optimal swap() just wants to swap()=
 the members. If you aren&#39;t defining copy and move operations almost su=
rely the =3Ddefault swap implementation is what you want. std::swap can&#39=
;t do this because its impossible to write a template that calls swap() on =
all of the private data members of a type. That&#39;s a different proposal =
though...</div><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 style=3D"word-wrap:break-word"><div><div>Question for all: Must qual=
ified=C2=A0<font face=3D"Courier">std::swap</font>=C2=A0be supported as an =
accessor to the three-move algorithm, e.g. for ADL overloads that add side-=
effects but not optimization?</div></div></div></blockquote><div><br></div>=
<div>Allow implicit swap() =3D default; like I just mentioned above, and yo=
u don&#39;t need this feature anymore.</div><div>=C2=A0</div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px =
#ccc solid;padding-left: 1ex;"><div style=3D"word-wrap:break-word"><div>Per=
haps it would be a good idea, going forward, to forbid ADL hooks from calli=
ng their <font face=3D"Courier">std::</font> counterparts, so that <font fa=
ce=3D"Courier">std</font> may encapsulate ADL.</div></div></blockquote><div=
><br></div><div>Sounds like a rule for the C++ guidelines project. A static=
 analyzer can probably pick up a lot of violations of this rule.=C2=A0</div=
><div><br></div><div>The big problem is if someone already calls std::swap =
from swap and upgrades, their code will change to an infinite loop.</div><d=
iv><br></div><div>Alternatively swap() could be an operator &gt;=3D&lt; lik=
e some other proposals have suggested. Then it can be overloaded in the glo=
bal namespace for builtin types just like operator=3D allow ADL to work cor=
rectly.</div><div><br></div><div>ADL is insufficient by itself for &quot;na=
med operators&quot; like swap() and begin(). ADL only works if the built-in=
 types have overloads in the global namespace, which fine for operator over=
loading but not really a good practice for named functions.=C2=A0</div></di=
v>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_983_1050831295.1443805101950--
------=_Part_982_1385273883.1443805101950--

.