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

1227. <bitset> synopsis overspecified

Section: 22.9.2 [template.bitset] Status: C++11 Submitter: Bo Persson Opened: 2009-10-05 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [template.bitset].

View all issues with C++11 status.

Discussion:

The resolutions to some library defect reports, like 1178 requires that #includes in each synopsis should be taken literally. This means that the <bitset> header now must include <stdexcept>, even though none of the exceptions are mentioned in the <bitset> header.

Many other classes are required to throw exceptions like invalid_argument and out_of_range, without explicitly including <stdexcept> in their synopsis. It is totally possible for implementations to throw the needed exceptions from utility functions, whose implementations are not visible in the headers.

I propose that <stdexcept> is removed from the <bitset> header.

[ 2009-10 Santa Cruz: ]

Moved to Ready.

Proposed resolution:

Change 22.9.2 [template.bitset]:

#include <cstddef>        // for size_t
#include <string>
#include <stdexcept>      // for invalid_argument,
                          // out_of_range, overflow_error
#include <iosfwd>         // for istream, ostream
namespace std {
...