home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!spool.mu.edu!umn.edu!news.cs.indiana.edu!usenet.ucs.indiana.edu!nsundare@silver.ucs.indiana.edu
- From: Neelakantan Sundaresan <nsundare@silver.ucs.indiana.edu>
- Subject: Another one on friends of templates
- Message-ID: <BuLBBM.Ity@usenet.ucs.indiana.edu>
- Sender: <nsundare@silver.ucs.indiana.edu>
- Organization: Indiana University
- Date: Mon, 14 Sep 1992 22:47:40 GMT
- X-Mailer: ELM [version 2.3 PL11]
- Lines: 37
-
-
- on CC,
- The following would work...
- --------
- class X {
- private:
- enum {a=100};
- int i;
- friend class Y;
- };
- class Y { int v[X::a];
- f(X *x) { return x->i;};};
- -----------
-
- But this one wouldnot...
- ----------
- template <class templ> class T {
- public:
- T() {};
- private:
- friend class C;
- int l;
- };
- class W { public: W(){};};
- typedef T<W> neel;
-
- class C
- {
- dummy(neel *c) { return c->l;};
- ^^^ access to private member of T<W>?
- public: C() { };
- };
- ------------
-
- any clues?
- thanks
- neel.
-