I'm pretty new to programming in C++. I've done some C# over the years, but I wouldn't say I am proficient at it. I'm trying to change some code from native c++ to C++/CX and keep hitting lots of compiler errors, specifically in concern to vectors. I've been reading through MSDN - Collections (C++/CX) and gathered that I need to use an IVector.
I have a struct defined in another header file:
typedef struct myStruct{
float p;
double x;
double y;
uint id;
}
I used a vector of this struct as a parameter in a method declaration:
void ProcessStruct (std::vector<myStruct> myStructs){}
When converting it to an IVector, like so:
void ProcessStruct (Windows::Foundation::Collections::IVector<myStruct>^ myStructs){}
I always end up getting compiler error C3225: "generic type argument for 'arg' cannot be 'type', it must be a value type or handle type". I tried using using IVector<myStruct^>^
instead, but then I just end up with C3699: "operator' : cannot use this indirection on type 'type'"
So I guessing my only option is to create a generic , but here I get very confused as to what I am actually supposed to be doing. How do I take a struct and turn it in to a generic? What is std::vector doing that IVector cannot?