The old programm uses vector as a container for a self-defined type like:
std::vector<my_type> m_my_type_queue;
And it is using vector's api like:
m_my_type_queue.size();
m_my_type_queue.begin();
Now I would like to extend the queue with an extra tag, so I embeded the vector together with a tag like:
struct my_type_queue {
std::vector<my_type> m_vector;
mutable bool tag;
}
my_type_queue m_my_type_queue;
But the problem with this implementation is that I need to access the queue with an extra layer,like:
m_my_type_queue.m_vector.size();
m_my_type_queue.m_vector.begine();
My question is how I may access the member the same way as before but can access the tage as well, something like:
m_my_type_queue.size(); // the same as original implementation
m_my_type_queue.begin(); // the same as original implementation
m_my_type_queue.tag = true; // new feacture with tag access
I can re-define those API for vector and forward them to the real vector but is there any easy way to do that?