summaryrefslogtreecommitdiffstats
path: root/Bachelor/Prog2/person-tree/Person.cpp
blob: f1e5206cd4636011ab88c7e1a7462a9b1245d79c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Person.cpp: Implementation of class Person



#include <iostream>

using std::cout;

using std::endl;

using std::ostream;



#include <string>

using std::string;



#include "Person.h"



Person::Person( string last, string first )

{	

   lastName = last;

   firstName = first;

}



bool Person::operator<( const Person& p ) const

{	

   return  lastName <  p.lastName ||

         ( lastName == p.lastName &&

	        firstName  <  p.firstName );

}



ostream& operator<<( ostream& output, const Person& p )

{  

   cout << p.lastName << ", " << p.firstName << endl; 



   return output;

}