home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 16072 < prev    next >
Encoding:
Internet Message Format  |  1992-11-10  |  1.5 KB

  1. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!spool.mu.edu!agate!netsys!news!lsi!mhost!cl301!ameesh
  2. From: ameesh@lsil.com (Ameesh Desai)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: template question
  5. Message-ID: <1992Nov10.212645.21472@lsil.com>
  6. Date: 10 Nov 92 21:26:45 GMT
  7. References: <1992Nov9.121452.22811@aber.ac.uk>
  8. Sender: news@lsil.com (news caster)
  9. Reply-To: ameesh@lsil.com
  10. Organization: LSI Logic Corporation
  11. Lines: 33
  12. Nntp-Posting-Host: cl301
  13.  
  14. In article 22811@aber.ac.uk, brw@aber.ac.uk (Benjamin Roy Whittle) writes:
  15. >
  16. >    If I write the following
  17. >
  18. >template<class T>
  19. >class stack { /* public interface stuff push pop etc*/};
  20. >
  21. >but I want to say that the class T should have a function copy available
  22. >for objects of that class, so that the function can be used in the
  23. >implementation of the stack.
  24. >
  25. >How do I do it please?
  26. >
  27. >email appreciated.
  28. >
  29. >ben
  30. >
  31. >brw@aber.ac.uk
  32.  
  33.  
  34. You can't see ARM Page 343 ... "Specifying no restrictions on what types can match
  35. a type argument gives the programmer the maximum flexibility. The cost is that errors
  36. ... will not in general detected until link time...."
  37.  
  38. Hopefully the linker generates an appropriate error message.
  39.  
  40. Ameesh
  41. ---
  42. ______________________________     o__            
  43. | _   /|     Ameesh Desai     \    ,>/_                              
  44. | \`O.o'     LSI Logic Corp.   \__(_)`(_)_              email: ameesh@lsil.com
  45. | =(_|_)=    MS E192, 1501 McCarthy Blvd. \             fax  : (408) 433-6802
  46. |____U_______Milpitas, CA 95035____________\____________voice: (408) 433-4097 
  47.