home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18303 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  1.2 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!sbsvax!joker!stefan
  2. From: stefan@mpi-sb.mpg.de (Stefan Naeher)
  3. Newsgroups: comp.lang.c++
  4. Subject: A Template Question
  5. Message-ID: <23504@sbsvax.cs.uni-sb.de>
  6. Date: 22 Dec 92 11:39:58 GMT
  7. Sender: news@sbsvax.cs.uni-sb.de
  8. Reply-To: stefan@mpi-sb.mpg.de
  9. Organization: Max-Planck Institut fuer Informatik
  10. Lines: 30
  11.  
  12.  
  13. Is it allowed to use a template class name  for a class member ?
  14. Cfront3.0.1 seems to handle this case not correctly.
  15.  
  16. The following piece of code is compiled without any error message
  17.  
  18.    template <class T>  class A { };
  19.  
  20.    struct B
  21.    {
  22.      int A;
  23.  
  24.     };
  25.  
  26.  
  27. however, if I change the type of B::A to int* cfront says   
  28. "error:  A needs template instantiation arguments".
  29.  
  30. What is the correct behaviour?
  31.  
  32.  
  33. -------------------------------------------------------------------------------
  34. Stefan N"aher                                      e-mail: stefan@mpi-sb.mpg.de
  35. Max-Planck-Institut f"ur Informatik                phone:  +49 681 302 5420
  36. Im Stadtwald                                       fax:    +49 681 302 5401
  37. 6600 Saarbr"ucken
  38. Germany
  39. -------------------------------------------------------------------------------
  40.  
  41.  
  42.