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

Aperta
#513 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
api

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C++
Stelle
12
Fork
4
Merge medio
1g 11h
PR unite (30g)
15

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di jbcoe/cc-protocol

Tutte le issue di jbcoe/cc-protocol

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.