I have a customer class containing Name and Age. I am wrapping the customer class in a smart pointer and made a vector of the smart pointer.
I have taken 3 customers and pushed them into the vector. Now I want to show the customers details by using for_each algorithm. But I am not able to write the code for functor Display(). Can any body help. Given my code below.
class customer {
private:
int Age;
string Name;
public:
customer();
customer(int x, string y):Age(x),Name(y) {
}
~customer() {
cout << "Destructor of customer is called" << endl;
}
int getAge() const{
return Age;
}
string getName() const{
return Name;
}