A RetroSearch Logo

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

Search Query:

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

Issue 3596: ranges::starts_with and ranges::ends_with are underspecified

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

3596. ranges::starts_with and ranges::ends_with are underspecified

Section: 26.6.16 [alg.starts.with], 26.6.17 [alg.ends.with] Status: NAD Submitter: Michael Schellenberger Costa Opened: 2021-09-17 Last modified: 2021-09-24

Priority: Not Prioritized

View all issues with NAD status.

Discussion:

When implementing C++23 new ranges::starts_with and ranges::ends_with for MSVC we came around some issues regarding infinite ranges.

In short, there is no possible answers to ends_with, if the second range is infinite. Similarly, there is no meaningful answer to starts_with if both ranges are infinite. We should constraint both algorithms to forbid those corner cases (preferred resolution), or explicitly specify a given return value for those (The reasonable choice would be "return false;")

[2021-09-24 infinite ranges are invalid by [iterator.requirements.general] p10, so undefined by p12. Might be nice to relax this in future, but needs a paper. Status changed: New → NAD.]

Proposed resolution:


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