the code isn't working and I'm not sure where I've gone wrong any help would be much appreciated this is the details of the assignment create a class template by writing a template for a class named "Pair". This class will represent a pair of data members of a type that is parameterized in the template definition. For example, you could have a Pair of integers, a Pair of doubles, etc.
/* so I'm trying to implement this driver this is the driver.cpp file and
* I'm trying to do it with a template class */
int main()
{
Pair<char> letters('a', 'd');
cout << "\nThe first letter is: " << letters.getFirst();
cout << "\nThe second letter is: " << letters.getSecond();
cout << endl;
cin.get();
}
//this is my .h file code
template <class T>
class Pair
{
private:
T first;
T second;
public:
Pair(const T, const T);
T getFirst();
T getSecond();
};
//this is my Pair.cpp
#include "Pair.h"
template<class T>
Pair<T>::Pair(const T first, const T second)
{
return first, second;
}
template<class T>
inline T Pair<T>::getFirst()
{
return first;
}
template<class T>
inline T Pair<T>::getSecond()
{
return second;
}