LWG-2220 Under-specification of `operator==` for `regex_token_iterator`

オープン
#6,556 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp
領域
backend

調査の方向性

Read stl/inc/regex around lines 3183–3189 and compare regex_token_iterator::operator== with the quoted WG21-N5054 Returns wording. Check the implementation against the end-of-sequence, suffix, and ordinary iterator cases; also consider whether a debug precondition check for the same underlying sequence is feasible. Done means the implementation's behavior and any proposed check are assessed against the stated requirements.

索引モデルが issue の本文から書いたものです。

説明

LWG regex

LWG-2220 Under-specification of operator== for regex_token_iterator

This LWG issue resolution is adding Preconditions, which would usually make it N/A for us, under the heading of "Something that increases the restrictions placed on users, but implementers aren't expected to enforce those restrictions." However, I'm tracking this with a GitHub issue for two reasons:

(1) We should consider whether it's feasible to add a debug precondition check for "same underlying sequence".

(2) It's unclear to me whether we correctly implement the existing Returns. Currently that's WG21-N5054 [re.tokiter.comp]/1:

bool operator==(const regex_token_iterator& right) const;
Returns: true if *this and right are both end-of-sequence iterators, or if *this and right are both suffix iterators and suffix == right.suffix; otherwise returns false if *this or right is an end-of-sequence iterator or a suffix iterator. Otherwise returns true if position == right.position, N == right.N, and subs == right.subs. Otherwise returns false.

The code doesn't immediately strike me as Doing What The Standard Says:

https://github.com/microsoft/STL/blob/0cabaf3c7e0a73fe3040aabce40cd8833e80392b/stl/inc/regex#L3183-L3189

主要言語
C++
スター
11.2k
フォーク
1.7k
平均マージ
4日 4時間
マージ済み PR(30日)
14

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/STL のほかの issue

microsoft/STL の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。