Comparison between two protocol objects
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
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- cpp
- Ambito
- backend-api-design
Direzione di ricerca
The issue names no files or tests. Start by reading #439 and #208, then trace the protocol and protocol_view comparison design described here; done means the open semantic, type-identity, mismatch, valueless, conversion, and scope questions have a decided specification.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
#439 forwards member comparisons with an operand of another type and rejects any comparison on an interface I with an operand of type I. The idiomatic declaration is therefore free to be given a meaning:
struct I {
bool operator==(const I&) const = default;
auto operator<=>(const I&) const = default;
};
protocol<I> p(A{}), q(B{});
p == q;
Open questions:
- Meaning. Does
const I&stand for the conforming type itself? Conformance would then meanChasoperator==(const C&) const, andprotocol<I>would getoperator==(const protocol&) const. Should that apply only to defaulted comparisons, or to user-declared ones as well? - Type identity. The thunk must know that both operands hold the same
Cbefore it casts.typeidneeds RTTI. The vtable address is cheap but not reliably unique across shared libraries. - Mismatched types.
==can returnfalse.<=>could returnpartial_ordering::unordered(which rules outstrong_orderingon the interface), order bytype_index(an unspecified order), or throw as Boost.TypeErasure does.std::polymorphicomits comparison for this reason. - Valueless operands. See #208.
protocol_view. Does it compare the referenced objects or the pointers? Should mixedprotocol/protocol_viewcomparison be allowed?- Conversions between interfaces. What does a comparison that names the conforming type do when a protocol converts to another interface?
- Scope. Does "own type" stop at comparisons, or extend to members such as
void merge(const I&)andI clone() const?
An alternative is a library opt-in (a tag base or trait) in place of rewriting const I&. That works against the design's premise that the interface struct is the whole specification.
- 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