Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!ctrsol!emory!jdyx!tpf From: tpf@jdyx.UUCP (Tom Friedel) Newsgroups: comp.lang.c++ Subject: implementation question libg++ List.ccP Message-ID: <1989Aug26.231103.4025@jdyx.UUCP> Date: 26 Aug 89 23:11:03 GMT Distribution: usa Organization: JDyx Enterprises (Atlanta GA) Lines: 43 I am using g++ and the List.hP, List.ccP LISP List prototypes in libg++. I would like to have a list of arbitratry structures. SInce a structure might be in several lists, I believe that I want lists of pointers to these arbitrary structures. A libg++ List node looks like (with arbirtary user-defined type Q) struct QListNode { QListNode* tl; short ref; Q hd; }; The type Q must be defined so that I can overload the == operator. This is a requirement of libg++ as well as my application. How would I implement type Q and the arbitrary structure, and do I generate the class List by value or reference? What I did was define a struct X { ------ } ; // my arbitrary structure and defined Q as typedef X * Q ; and built List.ccP by reference. This compiles and runs O.K., but now need to define an == operator for Q, and don't really know how, and suspect that I have implemented things wrong. Thanks for any help, Tom -- Tom Friedel Public Access Unix BBS tpf@prism.gatech.edu ...gatech!emory!jdyx!tpf (404) 320-7624 (404) 321-5020