Embedded C++ static initialization of struct arrays
问题 While migrating to C++ I require a certain function that seems to have been deprecated. sorry, unimplemented: non-trivial designated initializers not supported What is the correct way to implement the following data storage system in C++ for memory constraint systems? typedef union union_t { float f; int i; } arg; typedef struct type_t { int a; arg b; int d; } element; const element list[] = { { .a = 1, .b = { .f = 3.141519f }, .d = 6 }, { .a = 3, .b = { .i = 1 }, } }; Often the use of std