template <class S> class Array {
// Blah, blah, blah...
};
where S is sub-type of a given type T . How could I do this (without creating an over-complicated code)?
Thanks in advance.
Karmalaa
Edited by - karmalaa on 11/9/00 3:22:52 AM
Not so generic template...
I'd like to develop a C++ template where the (so called) "istantiation class(es)" needs to be (at least) sub-type of another type.
That is (for example):
---[home page] [[email=karmalaa@inwind.it]e-mail[/email]]
by sub-type you mean derived class?
you just do it, as far as I can tell the only way to make it obvious is to use a descriptive name for the template parameter (instead of "T")
you just do it, as far as I can tell the only way to make it obvious is to use a descriptive name for the template parameter (instead of "T")
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement