-
January 29th, 2004, 05:27 AM
#1
Doubt in STL-MAP!!!!
Hi All,
After all the datas are insert to the MAP, is it is possible to re-sort the MAP using some other key ??
With Best Regards,
A.Ilamparithi
-
January 29th, 2004, 08:58 AM
#2
You must erase the key and use a different key. A map automatically sorts when you insert elements.
Regards,
Paul McKenzie
-
January 29th, 2004, 09:26 AM
#3
Re: Doubt in STL-MAP!!!!
Originally posted by ilamparithi
Hi All,
After all the datas are insert to the MAP, is it is possible to re-sort the MAP using some other key ??
No, that's not possible. An std::map is always sorted by the key type that is given to it at compile-time. The only way you can sort by something else is to copy the contents to a new map or vector which is then sorted on a different key.
You must erase the key and use a different key.
I'm not sure what you mean here.
Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
Supports C++ and VB out of the box, but can be configured for other languages.
-
January 29th, 2004, 11:02 AM
#4
Re: Re: Doubt in STL-MAP!!!!
Originally posted by Yves M
I'm not sure what you mean here.
Assuming that the OP wants to have the data show up somewhere else in the map, he has to delete the old key and reinsert the data with a new key.
Regards,
Paul McKenzie
-
January 29th, 2004, 11:06 AM
#5
Re: Re: Re: Doubt in STL-MAP!!!!
Originally posted by Paul McKenzie
Assuming that the OP wants to have the data show up somewhere else in the map, he has to delete the old key and reinsert the data with a new key.
Ah, I get it. I didn't the read the question that way
Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
Supports C++ and VB out of the box, but can be configured for other languages.
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
|