Posted By

brentroady on 09/11/06


Tagged

datastructure stl


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

yuconner
copyleft
khouser


Comparison function for std::map


 / Published in: C++
 

  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
Posted By: the_coder on June 4, 2008

the comparison function for char* already exists

You need to login to post a comment.