This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libstdc++-v3][C++14] Implement N3654 - Quoted Strings


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]