This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [libstdc++-v3][C++14] Implement N3654 - Quoted Strings
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Ed Smith-Rowland <3dw4rd at verizon dot net>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 5 Jun 2013 21:01:04 +0100
- Subject: Re: [libstdc++-v3][C++14] Implement N3654 - Quoted Strings
- References: <51AF8F13 dot 80807 at verizon dot net>
On 5 June 2013 20:18, Ed Smith-Rowland wrote:
> Greetings,
> This patch implements quoted string manipulators for C++14.
>
> 27.7.6 - Quoted manipulators [quoted.manip].
>
> The idea is to allow round trip insert and extract of strings with spaces.
>
> std::stringstream ss;
> std::string original = "thing1 thing1";
> std::string round_trip;
> ss << std::quoted(original);
> ss >> std::quoted(round_trip);
> assert( original == round_trip );
>
> Builds and tests clean on x86-64-linux.
As I suggested for your literals patch, couldn't the test for:
#if __cplusplus > 201103L
go inside the existing one?
i.e.
#if __cplusplus >= 201103L
[...]
#if __cplusplus > 201103L
[...]
#endif
#endif
_Quoted_string appears to do two copies of the string, one for the
constructor argument and one for the member variable, do they
definitely get elided?
The members of _Quoted_string should be named _M_xxx not __xxx, to
follow the coding style guidelines.
What is __delim2 for?
What if the first extraction in the operator>> fails, is doing
__is.unget() the right thing to do?
You could simplify the quoted() overloads by using auto return type
deduction, is it an intentional choice not to use that?