SK
Cell
{
string TypeName;
??? AnyType;
}
Аля:
Cell row[3];
row[0] = Cell(123);
row[1] = Cell(123.123f);
row[2] = Cell("text");
Size: a a a
SK
Cell
{
string TypeName;
??? AnyType;
}
Cell row[3];
row[0] = Cell(123);
row[1] = Cell(123.123f);
row[2] = Cell("text");
СК
template <typename T>
struct Cell {
std::string type;
T data;
};
/* Или */
std::variant<int, huint, pizda, ruly> aaaaa;
СК
access: std::get<T>(variant);
SK
template <typename T>
struct Cell {
std::string type;
T data;
};
/* Или */
std::variant<int, huint, pizda, ruly> aaaaa;
SK
access: std::get<T>(variant);
SK
СК
Cell<T> arr[n];
std::variant<AnyTypes...> arr[n];
СК
std::variant afaik since C++17
SK
std::variant afaik since C++17
СК
СК
struct SimpleVariant {
union data {
uint8_t uint8;
// TODO: see you next time!
};
uint8_t type;
};
SK
struct SimpleVariant {
union data {
uint8_t uint8;
// TODO: see you next time!
};
uint8_t type;
};
СК
struct SimpleVariant {
union data {
int int_v;
std::string str_v;
double double_v;
};
uint8_t type;
};
#define INT_TYPE 0u
#define STRING_TYPE 1u
#define DOUBLE_TYPE 2u
SimpleVariant variant {};
variant.data.double_v = 10.0;
variant.type = DOUBLE_TYPE;
СК
СК
СК
СК
СК
СК
СК