alecthomas / alecthomas/entityx

Allow aggregate initialisation of components?

Offen
#212 13 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C++
Sterne
2.3k
Forks
301
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

https://github.com/alecthomas/entityx/blob/6389b1f91598c99d85e56356fb57d9f4683071d8/entityx/Entity.h#L648

Seems like the line I've tagged could be easily changed to use brace initialisation rather than direct initialisation. I'm wondering if this has been considered previously and any reason for the choice to avoid it.

Brace initialisation would allow for [aggregate initialisation](https://en.cppreference.com/w/cpp/language/aggregate_initialization) meaning that you don't need to manually create a constructor for each component. Given that components should frequently qualify as aggregates this would seem to be a nice improvement by removing the need to create constructors unnecessarily.

Thoughts?

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.