home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16712 < prev    next >
Encoding:
Text File  |  1992-11-21  |  1.0 KB  |  38 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!secapl!Cookie!frank
  3. From: frank@Cookie.secapl.com (Frank Adams)
  4. Subject: Re: Templates parameterized on templates (!)
  5. Message-ID: <1992Nov21.180344.101927@Cookie.secapl.com>
  6. Date: Sat, 21 Nov 1992 18:03:44 GMT
  7. References: <1992Nov19.215956.20239@cssc-syd.tansu.com.au>
  8. Organization: Security APL, Inc.
  9. Lines: 27
  10.  
  11. In article <1992Nov19.215956.20239@cssc-syd.tansu.com.au> pete@cssc-syd.tansu.com.au (Peter Alexander Merel) writes:
  12. >template<template Container, class T>
  13. >class troppo
  14. >:
  15. >    public Container<T>
  16. >{
  17. >    ...
  18. >};
  19. >
  20. I'm not up on whether real live 3.0 compilers will do this
  21. >or not. If they don't I think they should. 
  22.  
  23. They don't, and I think they should, too.  But the first line should
  24. probably be either:
  25.  
  26. template<template<class> Container, class T>
  27.  
  28. or
  29.  
  30. template<template Container<class>, class T>
  31. ---------------
  32. In the mean time, you can write:
  33.  
  34. template<class Container, class T>
  35.  
  36. with the assertion that the template will only work if Container is a
  37. container class whose element type is T.
  38.