Introduction to OOP Chapter 18: Generics : next previous audio real text

Can Even Be Used with User Defined Types

class Fraction {
public:
	Fraction (int top, int bottom) { t = top; b = bottom; }

	int numerator() { return t; }
	int denominator() { return b; }

	bool operator < (Fraction & right) 
		{ return t * right.b < right.t * b; }

private:
	int t, b;
};

Fraction x(3, 4);
Fraction y(7, 8);
Fraction z = max(x, y);
Intro OOP, Chapter 18, Slide 03