Suppose I have the following code (C++):
template < class Td, class Ud, class Vd>
class Extractor
{
private:
// some code here
public:
// the class has functions to populate these vectors
vector<Td* > list_of_layers;
vector<Ud* > list_of_resistors;
vector<Vd* > list_of_nodes;
}
I wish to impose the restriction that the classes that are used to replace Td, Ud and Vd while instantiating an object of class Extractor are ALWAYS derived from classes (say) T, U and V, respectively. Is it possible?