DRAFT.md: state the T-vs-I special member rule and the move-semantics divergence from P3019
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- cpp
Línea de trabajo
Comienza en DRAFT.md, bajo Design, especialmente en “Generated structural subtyping”, y compara la redacción relevante sobre el constructor y la asignación en P3019R14. Documenta las restricciones relativas a T e I y, después, indica la divergencia en la semántica de movimiento y las condiciones del allocator; consulta #76, #193 y #148 para conocer el contexto de la redacción formal y de la implementación.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Two gaps in DRAFT.md surfaced while looking at #187. Both concern how protocol's special member functions relate to those of std::polymorphic (P3019R14).
1. Constraints on T relative to I
DRAFT.md (Design, "Generated structural subtyping") says that if I has deleted special member functions, the corresponding members of protocol are not generated. It does not state the converse requirement on the stored type: a T must be copy constructible if I is, and move constructible if I is.
P3019 states this per constructor as a Constraints element (is_copy_constructible_v<U> on every constructor taking a U). protocol needs the generalised form, since it admits non-copyable interfaces:
Constraints:
is_copy_constructible_v<T>istrueifis_copy_constructible_v<I>istrue;is_move_constructible_v<T>istrueifis_move_constructible_v<I>istrue.
This belongs in the Design section now and in the formal wording when #76 restores it. The implementation side is #193.
2. Divergence from P3019 on moves with equal allocators
P3019 [polymorphic.ctor]/8-9 and [polymorphic.assign]/6 permit the implementation to construct a new owned object "considering the owned object as an rvalue" even when the allocators compare equal; the drafting notes say this is to leave room for a small-buffer optimisation. That is only sound because every owned U is required to be copy constructible.
protocol cannot adopt that freedom: an immovable I (deleted move constructor) must still yield a movable protocol<I> for the default allocator and for any allocator where is_always_equal or propagate_on_container_move_assignment holds, and the only way to provide that is a guaranteed pointer steal when allocators compare equal. The paper should say so explicitly:
- Move construction and move assignment of
protocolnever construct a new object of the stored type when the allocators compare equal (or the allocator propagates). They arenoexceptin those cases. - Only the allocator-extended move constructor and move assignment with unequal, non-propagating allocators construct from the stored object as an rvalue, and those members are constrained on
is_move_constructible_v<I>.
This also constrains #148: SBO would only be permissible for a protocol<I> where I is move constructible.
- 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 5/5 Más de una semana Aptitud para principiantes 15/100
jbcoe/cc-protocol#513 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
jbcoe/cc-protocol#511 ·
Los mantenedores suelen responder en 1 día
Todos los issues de jbcoe/cc-protocol
Issues similares
-
multilabel_margin_loss returns an unwritten scalar for an empty CPU batch with reduction='sum'Abiertobot-triaged module: correctness (silent) module: cpu module: empty tensor module: loss triage review
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
stephenberry/glaze#3126 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ultravideo/kvazaar#453 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
google-ai-edge/LiteRT-LM#4783 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día