I want to have a data structure of following type in c++.
map<string,pair<string,vector>>.
Any Suggestions?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No. You cannot have a data structure like that.
The reason is :
vectoris a class template, which means it requires you to pass type as template argument to it. If you do that, then you can most certainly have a data structure like this:where
Tis some type.Note that if you’re using C++03 (or C++98), then you have to put extra space between each pair of
>means>>>should look like> > >. However, in C++11, the extra space is not needed, means>>>should work just fine.