778. std::bitset does not have any constructor taking a string literal

Section: 23.9.2.1 [bitset.cons] Status: CD1 Submitter: Thorsten Ottosen Opened: 2008-01-24 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [bitset.cons].

View all issues with CD1 status.

Duplicate of: 116

Discussion:

A small issue with std::bitset: it does not have any constructor taking a string literal, which is clumsy and looks like an oversigt when we tried to enable uniform use of string and const char* in the library.

Suggestion: Add

explicit bitset( const char* str );

to std::bitset.

Proposed resolution:

Add to synopsis in 23.9.2 [template.bitset]

explicit bitset( const char* str );

Add to synopsis in 23.9.2.1 [bitset.cons]

explicit bitset( const char* str );

Effects: Constructs a bitset as if bitset(string(str)).