Hi,
I've written the paper 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
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-proposal...@isocpp.org.
To post to this group, send email to std-pr...@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
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 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.
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.
On 2015–10–02, at 2:53 PM, Sam Kellett <samke...@gmail.com> wrote: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.
On 2015–10–02, at 3:49 PM, Ville Voutilainen <ville.vo...@gmail.com> wrote:I have seen ruminations about a std::adl_swap that pulls in ADL.
On 2015–10–02, at 2:53 PM, Sam Kellett <samke...@gmail.com> wrote: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()Such a namespace name would be an oxymoron.or even:std::adl::swap()How about simply “std::swap” and let it do the work of pulling in ADL?
On 2015–10–02, at 4:07 PM, Sam Kellett <samke...@gmail.com> wrote:how would a user differentiate between a customization hook and something that isn't (like the rest of the std:: namespace)?
How about simply “std::swap” and let it do the work of pulling in ADL?to avoid breaking changes.
Question for all: Must qualified std::swap be supported as an accessor to the three-move algorithm, e.g. for ADL overloads that add side-effects but not optimization?
Perhaps it would be a good idea, going forward, to forbid ADL hooks from calling their std:: counterparts, so that std may encapsulate ADL.