William Adams wrote: > I have need to access the type of the parameter used to construct a > parameterized structure: > local Vector = ffi.typeof("struct { int n; int Capacity; $ *Data; }", > ct); > Is there any way to get at what 'ct' was from within a metamethod? > I can find out how large it is by doing ffi.sizeof(instance.Data[0]) > but, all I get out of ffi.typeof(instance.Data) is "struct 102". > Alternative, could I use "struct 102" in any meaningful way, like > ffi.new("struct 102", 100); ffi.new() takes a cdecl (a string), a ctype object or a cdata object. So just use ffi.new(instance.Data[0], ...). --Mike