// ------------------------------------------------------------------------ // This program is complementary material for the book: // // Frank Nielsen // // Visual Computing: Geometry, Graphics, and Vision // // ISBN: 1-58450-427-7 // // Charles River Media, Inc. // // // All programs are available at http://www.charlesriver.com/visualcomputing/ // // You may use this program for ACADEMIC and PERSONAL purposes ONLY. // // // The use of this program in a commercial product requires EXPLICITLY // written permission from the author. The author is NOT responsible or // liable for damage or loss that may be caused by the use of this program. // // Copyright (c) 2005. Frank Nielsen. All rights reserved. // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // File: genericdictionary.cpp // // Description: sample program that shows the use of a templated dictionary // ------------------------------------------------------------------------ #include "stdafx.h" using namespace std; class point { public: double x,y; }; class segment { public: point A,B; }; class Yline { public: static double x; double a,b; // equation of nonvertical line y=ax+b // Overloading bool operator < ( const Yline & rhs) { cout <<"\n\t\tGeneric dictionary (inferior): "<