A candidate's inherited member functions do not count toward conformance

Abierto
#513 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
15/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp
Área
api

Línea de trabajo

The decision is open: either collect member functions from accessible, unambiguous base classes or keep the current rule and document it. Start from members_of, which the issue says does not return base-class members, and from the xyz::protocol conformance check that rejects Derived. Done means a recorded decision, plus either base-class lookup that respects hiding and using-declarations or a diagnostic naming the base class. Confirm the direction with the maintainer before writing code.

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

Descripción

A type conforms to an interface only through member functions it declares itself. One that inherits them does not conform:

struct Drawable { void draw() const; };
struct Base { void draw() const; };
struct Derived : Base {};

xyz::protocol<Drawable> p(std::in_place_type<Derived>);  // error

Candidates are enumerated with members_of, which does not return the members of a base class. Derived d; d.draw(); is valid, so a user would expect Derived to conform.

Decide whether to:

  1. walk the candidate's accessible, unambiguous bases when collecting member functions, honouring hiding and using-declarations, or
  2. keep the current rule and document it, with a diagnostic that says the member function was found in a base class.

Related: #511 (base classes of an interface), #512.

Lenguaje dominante
C++
Estrellas
12
Forks
4
Merge medio
1 d 11 h
PR fusionados (30 d)
15

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

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 jbcoe/cc-protocol

Todos los issues de jbcoe/cc-protocol

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.