home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 16124 < prev    next >
Encoding:
Text File  |  1992-11-11  |  960 b   |  34 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!elroy.jpl.nasa.gov!usc!zaphod.mps.ohio-state.edu!darwin.sura.net!jvnc.net!gmd.de!Germany.EU.net!mcsun!news.funet.fi!aton.abo.fi!aton.abo.fi!rosenber
  3. From: rosenber@aton.abo.fi (Robin Rosenberg INF)
  4. Subject: templates within templates
  5. Message-ID: <ROSENBER.92Nov11235158@aton.abo.fi>
  6. Sender: usenet@abo.fi (Usenet NEWS)
  7. Organization: Abo Akademi University, Finland
  8. Distribution: comp
  9. Date: Wed, 11 Nov 1992 21:51:58 GMT
  10. Lines: 22
  11.  
  12.  
  13. I tried using templates like this:
  14.  
  15.     Ref<Node<T>> obj;
  16.  
  17. I tried Borland C++ (3.0) and g++ (2.1) and neither accepts the
  18. syntax. If I change this to
  19.  
  20.     typedef Node<T> Node_T;
  21.     Ref<Node_T> obj;
  22.  
  23. then it is accepted.
  24.  
  25. So the questions are:
  26.     Is it legal to use a template as class argument for a template?
  27.     If yes; which compilers accept it ?
  28.     Any ideas of how to avoid the problem besides using typedefs?
  29.  
  30. ----
  31.     Robin Rosenberg
  32.  
  33.  
  34.