最新的C ++版本(我猜是17还是20)是否可以在std :: array或std :: vector或其他内置数据类型中存储不同类型的元组?例如,类似->
struct bunchOfTuples {
std::tuple<float, float, int, int> firstTup = std::make_tuple(float, float, int, int);
std::tuple<float, float, int> secondTup = std::make_tuple(float, float, int); };
// bunch more tuples of differing types
};
是否有一些使用模板的方法来实现类似的目的?还是类或结构实现?还是我没想到我是最新C ++的新手?我正在研究一个自动方法调用项目。我有一些基本可行的方法,但这会使它更清洁。