#include <iostream>
#include <string>
#include <list>
class Something{
private:
string word;
int number;
public:
string getWord() const;
int getNumber() const;
}
class Bigger{
list<Something> List;
public:
//A template function which will search in 'List' an object with matched
// word/number(it will return an iterator to the object in 'List')
}
I want to implement this function with template pattern in order to avoid code duplication. How do I do it? Thanks!