This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of TC1 status.

209. basic_string declarations inconsistent

Section: 27.4.3 [basic.string] Status: TC1 Submitter: Igor Stauder Opened: 2000-02-11 Last modified: 2016-01-28

Priority: Not Prioritized

View other active issues in [basic.string].

View all other issues in [basic.string].

View all issues with TC1 status.

Discussion:

In Section 27.4.3 [basic.string] the basic_string member function declarations use a consistent style except for the following functions:

void push_back(const charT);
basic_string& assign(const basic_string&);
void swap(basic_string<charT,traits,Allocator>&);

- push_back, assign, swap: missing argument name 
- push_back: use of const with charT (i.e. POD type passed by value not by reference - should be charT or const charT& )
- swap: redundant use of template parameters in argument basic_string<charT,traits,Allocator>&

Proposed resolution:

In Section 27.4.3 [basic.string] change the basic_string member function declarations push_back, assign, and swap to:

void push_back(charT c); 

basic_string& assign(const basic_string& str);
void swap(basic_string& str);

Rationale:

Although the standard is in general not consistent in declaration style, the basic_string declarations are consistent other than the above. The LWG felt that this was sufficient reason to merit the change.