Archived
This forum has been archived. Please start a new discussion on GitHub.
Is it possible to house a collection within a struct?
Hi,
Whenever I attempt to place a squence within a struct, it gives a syntax error - is there any possible way to place a sequence within a struct?
["clr:generic:List"] sequence<string> StringSeq; // works
["clr:class"] struct Wrapper
{
["clr:generic:List"] sequence<string> StringSeq; // gives syntax error
string symbol;
};
Whenever I attempt to place a squence within a struct, it gives a syntax error - is there any possible way to place a sequence within a struct?
["clr:generic:List"] sequence<string> StringSeq; // works
["clr:class"] struct Wrapper
{
["clr:generic:List"] sequence<string> StringSeq; // gives syntax error
string symbol;
};
0
Comments
-
Hi,
User-defined types (structures, classes, sequences, dictionaries, exceptions, and enumerations) can only be defined at module scope.
Regards,
Mark0 -
No problem, I can easily adjust the interface slightly to eliminate this problem.0
-
No problem, I can easily adjust the interface slightly to eliminate this problem.
To clarify, this doesn't provide any limitation at all. The Slice file will handle any combination of nested structs that are possible in C++. All I need to do is define a new type which is a list of an existing type, at the global scope, then include that in the new structure. No limitations is good.0