用结构填充列表
Filling a List with struct
我是 C++/CLI 的新手,在使用列表方面遇到困难。
我有结构
#using namespace System::Collections::Generic
struct myStruct {
unsigned int A ;
int B; };
我想用 mystructs 创建一个列表
List<myStruct> myList;
但这似乎不起作用,Visual Studio 说
"myStruct is not a valid generic Argument",但为什么会这样呢?
我怎样才能使这个结构成为 "valid generic argument"?
#include <List>
struct myStruct {
unsigned int A ;
int B;
};
std::list<myStruct> myList;
int main(void) {
return 0;
}
我是 C++/CLI 的新手,在使用列表方面遇到困难。
我有结构
#using namespace System::Collections::Generic
struct myStruct {
unsigned int A ;
int B; };
我想用 mystructs 创建一个列表
List<myStruct> myList;
但这似乎不起作用,Visual Studio 说 "myStruct is not a valid generic Argument",但为什么会这样呢? 我怎样才能使这个结构成为 "valid generic argument"?
#include <List>
struct myStruct {
unsigned int A ;
int B;
};
std::list<myStruct> myList;
int main(void) {
return 0;
}