home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!ux1.cso.uiuc.edu!usenet.ucs.indiana.edu!nsundare@silver.ucs.indiana.edu
- From: Neelakantan Sundaresan <nsundare@silver.ucs.indiana.edu>
- Subject: friend classes of template classes
- Message-ID: <BuLA7w.HIt@usenet.ucs.indiana.edu>
- Sender: <nsundare@silver.ucs.indiana.edu>
- Organization: Indiana University
- Date: Mon, 14 Sep 1992 22:23:51 GMT
- X-Mailer: ELM [version 2.3 PL11]
- Lines: 28
-
-
- I am having problems compiling a friend class of a template class when
- it accesses a member of the friend class accesses a type defined in the
- template of which it is a friend.
- ----
- template <class T> class U
- {
- private:
- enum error { i, j, k};
- friend class W;
- public:....
- };
- class W
- {
- int error_fn(U::error);
- ^^^ point where the compiler needs an instantiation
- of the template.
- };
- Even if I give it an instantiation of the template as U<X> (where X is
- some defined class), the compiler screams saying size unknown.
- -----
-
- Any hints as to what I am doing wrong?
- thanks
- Neel.
- PS: This is with the CC translator.
-
-
-