[英]Template variables and the variables that can store template variables
有兩個變量
basic<type1> type_1;
basic<type2> type_2;
我想要這兩個變量來存儲另一個這樣的變量
basic<type1> type_1;
basic<type2> type_2;
var type = type_1 or type_2 // What type of variable should be declared?
謝謝。
您可以使用object
或dynamic
。
另外,如果basic<T>
繼承自可以說basic
那么您將可以使用basic
作為變量類型。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.