samedi 27 février 2016

Multiple types on a deque?

This is non-Boost C++11. What's the best option for a single stack-like container for two different types? Something that'd work like this imaginary scenario:

template<typename T>
deque <pair<T, v8::Local<v8::Value>>> my_queue;

uint32_t aUint = ...;
v8::Local<v8::Value> value1 = ...;
v8::Local<v8::String> aString = ...;
v8::Local<v8::Value> value2 = ...;

my_queue.push_back(make_pair(aUint, value1));
my_queue.push_back(make_pair(aString, value2));

Aucun commentaire:

Enregistrer un commentaire