Introduction to OOP: Chapter 15 : Case Study: Container Classes [next] [previous] [audio] [real] [text]

A Link for Double Precision Numbers

class  DoubleLink : public Link {
public:
	// data area
	double theValue;

	// constructor
	DoubleLink (double v) : theValue(v) {}

	// operations
	int operator == (Link * d)
		{ return thisValue == ((DoubleLink *) d)->theValue; }
};
Intro OOP, Chapter 15, Slide 8