By default, using std::vector<c++-type> is encoded as an AMQP array, whereas std::vector<proton::value> is encoded as an AMQP list. So, to create an array of lists of differing types, for example:

std::vector<proton::value> list1 = {uint8_t(0), uint8_t(1)};
std::vector<proton::value> list2 = {true, false};
std::vector<std::vector<proton::value> > array = {list1, list2};

works ok. However, how does one define an array of arrays of differing types? For example:

std::vector<uint8_t> array1 = {uint8_t(0), uint8_t(1)};
std::vector<bool> array2 = {true, false};
std::vector<std::vector<##> > array3 = {array1, array2};

What is ##? Unless all the sub-arrays are of the same type, it is not possible to define a single type here. If I use proton::value (which would make it indistinguishable from the array of lists above), I get a compile error:

could not convert '{array1, array2}' from '<brace-enclosed initializer list' to 'std::vector<std::vector<proton::value> >'

What is the correct way to create an array of arrays of differing types?

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to