A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/LWG/issue86 below:

String constructors don't describe exceptions

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.

86. String constructors don't describe exceptions

Section: 27.4.3.2 [string.require] Status: TC1 Submitter: Nico Josuttis Opened: 1998-09-29 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [string.require].

View all issues with TC1 status.

Discussion:

The constructor from a range:

template<class InputIterator> 
         basic_string(InputIterator begin, InputIterator end, 
                      const Allocator& a = Allocator());

lacks a throws clause. However, I would expect that it throws according to the other constructors if the numbers of characters in the range equals npos (or exceeds max_size(), see above).

Proposed resolution:

In 27.4.3.2 [string.require], Strike throws paragraphs for constructors which say "Throws: length_error if n == npos."

Rationale:

Throws clauses for length_error if n == npos are no longer needed because they are subsumed by the general wording added by the resolution for issue 83(i).


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4