Advertisement
ryancnap

Person.h

Apr 21st, 2024
545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. #include <string>
  2.  
  3. class Person
  4. {
  5.     private:
  6.         // TODO: update sortvalue with dependency injection to pass a value in and do conditional returns
  7.         string sortValue();
  8.  
  9.     public:
  10.         string personID, fName, lName, street, city, state, zip;
  11.  
  12.         bool operator == (Person p) {return (sortValue() == p.sortValue());};
  13.         bool operator != (Person p) {return (sortValue() != p.sortValue());};
  14.         bool operator > (Person p) {return (sortValue() > p.sortValue());};
  15.         bool operator < (Person p) {return (sortValue() < p.sortValue());};
  16.         bool operator >= (Person p) {return (sortValue() >= p.sortValue());};
  17.         bool operator <= (Person p) {return (sortValue() <= p.sortValue());};
  18.  
  19. };
  20.  
  21. #include "Person.cpp"
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement