home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!secapl!Cookie!frank
- From: frank@Cookie.secapl.com (Frank Adams)
- Subject: Re: Templates parameterized on templates (!)
- Message-ID: <1992Nov21.180344.101927@Cookie.secapl.com>
- Date: Sat, 21 Nov 1992 18:03:44 GMT
- References: <1992Nov19.215956.20239@cssc-syd.tansu.com.au>
- Organization: Security APL, Inc.
- Lines: 27
-
- In article <1992Nov19.215956.20239@cssc-syd.tansu.com.au> pete@cssc-syd.tansu.com.au (Peter Alexander Merel) writes:
- >template<template Container, class T>
- >class troppo
- >:
- > public Container<T>
- >{
- > ...
- >};
- >
- I'm not up on whether real live 3.0 compilers will do this
- >or not. If they don't I think they should.
-
- They don't, and I think they should, too. But the first line should
- probably be either:
-
- template<template<class> Container, class T>
-
- or
-
- template<template Container<class>, class T>
- ---------------
- In the mean time, you can write:
-
- template<class Container, class T>
-
- with the assertion that the template will only work if Container is a
- container class whose element type is T.
-