824. rvalue ref issue with basic_string inserter

Section: 24.3.3.9 [string.io] Status: CD1 Submitter: Alisdair Meredith Opened: 2008-04-10 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [string.io].

View all issues with CD1 status.

Discussion:

In the current working paper, the <string> header synopsis at the end of 24.3 [string.classes] lists a single operator<< overload for basic_string.

template<class charT, class traits, class Allocator>
 basic_ostream<charT, traits>&
   operator<<(basic_ostream<charT, traits>&& os,
              const basic_string<charT,traits,Allocator>& str);

The definition in 24.3.3.9 [string.io] lists two:

template<class charT, class traits, class Allocator>
 basic_ostream<charT, traits>&
   operator<<(basic_ostream<charT, traits>& os,
              const basic_string<charT,traits,Allocator>& str);

template<class charT, class traits, class Allocator>
 basic_ostream<charT, traits>&
   operator<<(basic_ostream<charT, traits>&& os,
              const basic_string<charT,traits,Allocator>& str);

I believe the synopsis in 24.3 [string.classes] is correct, and the first of the two signatures in 24.3.3.9 [string.io] should be deleted.

Proposed resolution:

Delete the first of the two signatures in 24.3.3.9 [string.io]:

template<class charT, class traits, class Allocator>
 basic_ostream<charT, traits>&
   operator<<(basic_ostream<charT, traits>& os,
              const basic_string<charT,traits,Allocator>& str);

template<class charT, class traits, class Allocator>
 basic_ostream<charT, traits>&
   operator<<(basic_ostream<charT, traits>&& os,
              const basic_string<charT,traits,Allocator>& str);