Comparison function for std::map


/ Published in: C++
Save to your folder(s)



Copy this code and paste it in your HTML
  1. class LessThan
  2. : public std::binary_function<char const *, char const *, bool>
  3. {
  4. public:
  5. bool operator () (char const * str1,
  6. char const * str2) const
  7. {
  8. return strcmp (str1, str2) < 0;
  9. }
  10. };
  11.  
  12. std::map<char*, char*, LessThan> ipmac;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.