How to get inner most nested struct
Hussien via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Mar 16 17:34:22 PDT 2017
struct VARIANT {
union {
struct {
VARTYPE vt;
WORD wReserved1;
WORD wReserved2;
WORD wReserved3;
union {
int lVal;
LONGLONG llVal;
ubyte bVal;
short iVal;
float fltVal;
double dblVal;
VARIANT_BOOL boolVal;
SCODE scode;
CY cyVal;
DATE date;
BSTR bstrVal;
IUnknown punkVal;
IDispatch pdispVal;
SAFEARRAY* parray;
ubyte* pbVal;
short* piVal;
int* plVal;
float* pfltVal;
double* pdblVal;
VARIANT_BOOL* pboolVal;
_VARIANT_BOOL* pbool;
SCODE* pscode;
CY* pcyVal;
DATE* pdate;
BSTR* pbstrVal;
IUnknown* ppunkVal;
IDispatch* ppdispVal;
SAFEARRAY** pparray;
VARIANT* pvarVal;
void* byref;
CHAR cVal;
USHORT uiVal;
ULONG ulVal;
ULONGLONG ullVal;
INT intVal;
UINT uintVal;
DECIMAL* pdecVal;
CHAR* pcVal;
USHORT* puiVal;
ULONG* pulVal;
INT* pintVal;
UINT* puintVal;
struct {
PVOID pvRecord;
IRecordInfo pRecInfo;
}
}
}
DECIMAL decVal;
}
}
I'd like to iterate over the members of the inner most union only
and only over fields(ignoring the pvRecord struct).
Anyway to do this? tuple of just returns everything. I know in
this case it is a simple filtering, but it would be nice to have
a more general solution.
More information about the Digitalmars-d-learn
mailing list