From -8100563237653959199 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,ede379f5dbbc1549 X-Google-Attributes: gidf78e5,public From: "Greg Brewer" Subject: Re: Suggestion: "typeof" keyword Date: 1999/08/16 Message-ID: <7p9pj8$2u9s$1@news.hal-pc.org>#1/1 X-Deja-AN: 513515017 X-NNTP-Posting-Host: dialup-0-21.orbitworld.net Approved: stephen.clamage@sun.com (comp.std.c++) References: <7nt3vl$1oe$1@nnrp1.deja.com> <7p1vfa$jnq$1@news.hal-pc.org> <37B82024.3E5A8013@wizard.net> X-UID: 0000000001 X-Priority: 3 X-Status: $$$T X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Organization: Houston Area League of PC Users, Inc. X-MSMail-Priority: Normal Newsgroups: comp.std.c++ Originator: clamage@taumet James Kuyper wrote in message news:37B82024.3E5A8013@wizard.net... > > Greg Brewer wrote: > ... > That problem, at least, looks like something to be resolved with a > simple typedef, in each class, of the corresponding record class. > > class Traits_Record; > > class Traits > { > public: > typedef record_type Traits_record; > > // The rest of your class definition > } I like your answer much better than mine. I did class Traits { public: Traits_record *Record(void) {return NULL;} // The rest of your class definition } ; template int Store(X *x, R *r) { R record; record << *x; ... } template int Store(X *x) { return Store(x,x->Record()); } Not only ugly, difficult to understand, but jumps around when tracing a call with a debugger. However, it does work! Greg Brewer [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]