简体   繁体   English

C ++将参数包扩展为数组的元组

[英]C++ expand parameter pack to tuple of arrays

I would like to instantiate a class like 我想类似实例化一个类

template<typename ...Args>
class X {
private:
    std::tuple<std::array<Arg0, 255>, std::array<Arg1, 255>, ...> m_tuples; // For Arg in Args
}

I know this is not correct C++, but how could I achieve the effect of expanding the parameter pack template of the class to the arrays held within the tuple? 我知道这不是正确的C ++,但是我怎样才能实现将类的参数包模板扩展到元组中保存的数组的效果?

template<typename ...Args>
class X {
private:
    std::tuple<std::array<Args, 255>...> m_tuples; // For Arg in Args
};

... you didn't expect to be so close, did you :) ......你没想到会如此接近,你呢:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM