home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / g / bug / 1858 < prev    next >
Encoding:
Text File  |  1992-11-22  |  1.5 KB  |  58 lines

  1. Newsgroups: gnu.g++.bug
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!math.uwaterloo.ca!xjzhu
  3. From: xjzhu@math.uwaterloo.ca (Xiaojun Zhu)
  4. Subject: bug in template?
  5. Message-ID: <By4Myz.EHA@math.uwaterloo.ca>
  6. Keywords: parse error, template
  7. Sender: gnulists@ai.mit.edu
  8. Organization: University of Waterloo
  9. Distribution: gnu
  10. Date: Sun, 22 Nov 1992 16:54:34 GMT
  11. Approved: bug-g++@prep.ai.mit.edu
  12. Lines: 44
  13.  
  14. Q: Gnu C++ has parse error on L<T> ? Is this due to a bug or incomplete 
  15.    template support?
  16.  
  17. Symptom: The following example(consists of two short files) compiles fine under 
  18. ATT C++ 3.0, but has parse error on line 8 of the first file when use g++.
  19.  
  20. Machine: MSDOS 
  21.  
  22. Version: djgpp109.zip (uploaded to Simtel on Nov2, 1992)
  23.  
  24. Command line: gcc -x c++ main.cc
  25.  
  26. My opinion: It seems to me that this version of Gnu C++ doesn't like us to use
  27.             L<T>, L<T1, T2> etc. in the construction of template class.
  28.             
  29. Example:
  30. file1: template.h
  31.  
  32. 1 template<class T>
  33. 2 class L
  34. 3 {
  35. 4   T _t;
  36. 6 public:
  37. 7   L(T t) : _t(t) {}
  38. 8   L(const L < T > & l) : _t(l._t) {}
  39. 9  ~L() {}
  40. 10 };
  41.  
  42. file2: main.cc
  43. 0. #include "template.h"
  44. 1 main()
  45. 2 {
  46. 3    L<int> x(2);
  47. 4 }
  48.  
  49.  
  50. --------------------------------------------------------------
  51.    A template version of signature class is under repair.
  52. Symptom: I can't seem to be able to dynamically allocate it.
  53.  
  54.                                        xjzhu@math.uwaterloo.ca
  55. --------------------------------------------------------------
  56.  
  57.