Looking into std::variant in c++17.
Is this the cpp "new" way to do union types?
What are the advantages ?
Post
Looking into std::variant in c++17.
Is this the cpp "new" way to do union types?
What are the advantages ?
@Ambraven Si ta fonction prends un variant, tu lui passes un objet d'un des types de ce variant de manière simple, sans avoir besoin de le transformer en variant<,>.
Si chaque types dans le variant à une méthode genre to_string(), tu peux appeler la méthode to_string du variant sans chercher à savoir de quel type il est.
Globalement c'est une manière transparente d'avoir des unions de type.
A space for Bonfire maintainers and contributors to communicate