|
-
February 2nd, 2012, 11:05 AM
#1
Deleting this particular std::map
Dear All,
could you kindly help me with deleting this std::map. Here are some details...
typedef std::map<std::string,int> N2v;
N2v n2v;
//Some looping construct
n2v.insert(....)
//End of some looping construct
//Now for the delete :
for(int i=0;i<n2v.size();i++){
// std::map<int>.swap(n2v[i]); -> IS WRONG. KINDLY GUIDE ME IN FIXING IT
}
std::map<std::string,int>().swap(n2v);
Thanks,
Ravi
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|