如何在运行时设置模板变量?

时间:2019-05-14 15:34:40

标签: c++ class templates struct

i是具有单个模板变量的结构。我在设置该变量时要尝试设置它的类型。

但是代码不断给出错误“类模板xyz的参数丢失”

template<typename T>
struct xyz{
     T d;
          };

void main()
 {
xyz a;
std::cin>>a.d;
 }

0 个答案:

没有答案
相关问题