, , , , ++, struct struct.
, std::vector - , , , .
. .
"" .
struct tag1_t {} tag1;
struct tag2_t {} tag2;
typedef std::tuple< std::pair< tag1_t, int >, std::pair<tag2_t, double> > header_t;
, " , ". , :
struct arr_t {} arr;
std::tuple< header_t, std::pair< arr_t, std::string > > full_t;
- mojo, , N , , int double, N std::string, . .
, , , . , , , .
, , , tuple s, reinterpret_cast , ( const, const).
, operator[], .
, std::vector , boost::mpl , , , , . , , ( ).
Foo* my_data = Foo::Create(7);
my_data->get<tag1_t>();
my_data->get<tag2_t>();
my_data->get<arr_t>()[3];
:
Foo* my_data = Foo::Create(7);
int x = my_data^tag1;
double y = my_data^tag2;
std::string z = my_data^arr[3];
, , .
, , , ++/C ++, , " ". ( , : , operator^ , ).
, , , , ++, , .