As a matter of interest, lets say I have the following class:
class Data
{
public:
template<class T>
std::vector<T> getData(std::string& dataName);
private:
...
}:
So the class stores a set of vectors of any type. Each vector has a name and I know its type when retrieving it. What container might I use to store this data within the Data class? A std::vector<std::pair<std::string,std::vector<T>>>?
UPDATE:
I will also need to iterate over this class and the items must be in the same orders as I added them.
For example, I might have:
ownerNames: std::vector<std::string>;
ipAddress: std::vector<char>;
in my store. So when I iterate I need them in this order.
If you know the type upon retrieval, use a
boost::any:Usage: