Код: Выделить всё
std::visit(&f, something);
Код: Выделить всё
#include
#include
#include
#include
struct A {
std::string name = "spencer";
};
struct B {
std::string type = "person";
};
struct C {
double age = 5;
};
void f(A a) {
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/66961406/c-variant-visit-overloaded-function[/url]