By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,562 Members | 1,222 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,562 IT Pros & Developers. It's quick & easy.

Re: std:less

P: n/a
Mike Copeland wrote:
typedef map<string, ChipRecordCHIPINFO;
Regardless of what ChipRecord is, that map will have an unambiguous
ordering because the operator<() for std::string will be used.
map<int, ChipRecord>::iterator cIter;
This is an iterator to a completely different map, but that one also
has a completely unambiguous ordering because the < operator for ints
will be used.

Let me guess: What you *really* want is this:

typedef std::set<ChipRecordCHIPINFO;

If that's the case, then simply define an operator<() for your
ChipRecord struct. Do whatever comparisons you need inside it.
Nov 16 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.