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

Abierto
#6,556 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
C++
Estrellas
11.2k
Forks
1.7k
Merge medio
4 d 4 h
PR fusionados (30 d)
14

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/STL

Todos los issues de microsoft/STL

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.