alecthomas / alecthomas/entityx

Allow for move-only components.

Aperta
#208 1 commento 3 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C++
Stelle
2.3k
Fork
301
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Right now, trying to do `e.assign(...)` for some C that has a deleted copy constructor will cause a substitution error when instantiating ComponentHelper::copy_component_to, even if that method is never called as the vtable still must be constructed. It would be nice to have proper support for move-only components as well.

A simple solution is to use SFINAE on ComponentHelper:
```
template
+class ComponentHelper>>: public BaseComponentHelper { ... }
```
and to not actually copy in copy_component_to, but that delays any errors trying to copy until runtime. That is suboptimal, and there should be a much more elegant solution.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.