Comparison between two protocol objects
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
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Activo
- Stack tecnológico
- cpp
- Área
- backend-api-design
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
#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.
- Lenguaje dominante
- C++
- Estrellas
- 12
- Forks
- 4
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 15
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de jbcoe/cc-protocol
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
jbcoe/cc-protocol#507 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
jbcoe/cc-protocol#455 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
jbcoe/cc-protocol#407 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
jbcoe/cc-protocol#194 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
jbcoe/cc-protocol#513 ·
Los mantenedores suelen responder en 1 día
Todos los issues de jbcoe/cc-protocol
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
itinance/react-native-fs#1270 ·
-
clang:frontend clang:openmp crash
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
llvm/llvm-project#245442 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
ai_p1 comp-sql-syntax
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
ClickHouse/ClickHouse#133888 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-2 días Aptitud para principiantes 65/100