alecthomas / alecthomas/entityx

Allow for move-only components.

Offen
#208 1 Kommentar 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C++
Sterne
2.3k
Forks
301
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.