Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!snorkelwacker!mit-eddie!mit-amt!peter From: peter@mit-amt.MEDIA.MIT.EDU (Peter Schroeder) Newsgroups: comp.lang.c++ Subject: strange binding of `*' in cfront 2.0, or is it? Keywords: initialization of static class members, cfront, weird Message-ID: <1370@mit-amt.MEDIA.MIT.EDU> Date: 10 Jan 90 22:20:29 GMT Organization: MIT Media Lab, Cambridge, MA Lines: 37 class abstract{ private: static int i; static int *ptr2i; static int *ptr2j; public: static int j; }; // what is going on???? int abstract::*ptr2i = &abstract::i; // this bombs int* abstract::ptr2i = &abstract::i; // this works int abstract::*ptr2j = &abstract::j; // this works // cfront 2.0 sez: // "test.C", line 11: error: ? cannot access abstract::i: private member // // this is almost identical to the example given in the `Product Reference // Manual', paragraph 9.4, page 60, where we have: // // process* process::run_chain = process::running; // // // Somehow the placement of the `*' seems to be crucial here... // // When I declare `int *i, j' the `*' binds to `i', not `int', since `j' // ends up just an integer not pointer to integer. Hence I think // writing `type class::*member' makes more sense then writing // `type* class::member'. In any case the reported error is less then // optimal especially since the syntax is acceptable in the `ptr2j' example. // // // Enlightenment is appreciated! // Peter // peter@media-lab.media.mit.edu