Reject every interface member that uses a reserved name, static members included
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- cpp
- Ambito
- devtools, documentation, testing
Direzione di ricerca
Start with protocol_interface_function_infos, named_member_function_infos, and the StaticInterfaceMemberWithReservedNameIsIgnored test to understand the current filtering. Review DRAFT.md's “Reserved member names” section and the rejected/ignored lists in #407, then confirm the intended rule with the issue options. Done means the selected behavior is covered by tests and the related documentation and reserved-name lists are consistent.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-up to #318, from the review of #449: https://github.com/jbcoe/cc-protocol/pull/449#discussion_r4057463300
#449 rejects a non-static interface member function named allocator_type, get_allocator or swap. A static member function with one of those names is skipped before the check, like every other static:
struct I {
static void swap(I&, I&) noexcept; // accepted and ignored
};
Nothing is hidden today, because interface statics are not forwarded. The case for rejecting it anyway:
- The rule is simpler to state: an interface cannot declare a member with a reserved name.
- Removing
staticlater turns an accepted interface into a rejected one. - If interface statics are ever forwarded, the reserved name would hide the generated member silently, which is what #318 set out to stop.
The same argument covers members the check never sees. named_member_function_infos filters on is_function, so a data member, static data member, alias or nested type with a reserved name is accepted too:
struct I {
using allocator_type = int; // accepted and ignored
int swap; // accepted and ignored
};
Options:
- Reject a static member function with a reserved name. Move
has_reserved_member_nameabove theis_static_memberskip inprotocol_interface_function_infos. - Reject any member with a reserved name, whatever its kind. Walk
members_ofthe interface once, before the function filter. - Leave statics and non-function members ignored, and say so in DRAFT.md.
2 gives the rule DRAFT.md can state in one sentence. Other statics stay ignored either way (#211, #403).
To change with it: the StaticInterfaceMemberWithReservedNameIsIgnored test, the "non-static member function" wording in DRAFT.md's "Reserved member names", and the rejected/ignored lists in #407. #450 adds protocol and protocol_view to reserved_member_names; the same rule should apply to them.
- Lingua principale
- C++
- Stelle
- 12
- Fork
- 4
- Merge medio
- 1g 11h
- PR unite (30g)
- 15
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di jbcoe/cc-protocol
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
jbcoe/cc-protocol#507 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
jbcoe/cc-protocol#455 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jbcoe/cc-protocol#407 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
jbcoe/cc-protocol#194 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
jbcoe/cc-protocol#513 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di jbcoe/cc-protocol
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
ai_p1 comp-sql-syntax
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
ClickHouse/ClickHouse#133888 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 Mezza giornata Idoneità per principianti 66/100
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno