previous | start | next

2.0 All function members of template classes are template functions



template <class T>
class Pair
{
public:
 Pair();
 Pair(const T& xval, const T& yval);
 T getFirst();
 T getSecond();
 
private:
 T x;
 T y;
};


template <class T>
T Pair<T>::getFirst()
{
  return x;
}

T Pair&T>::getSecond()
{
  return y;
}


previous | start | next