A
Alfonso Morra
Hi,
I want to be pass a list (1..N) of (different) types to a class template
- and I wonder if this can be done. Actually, because there are
different types, I think I will have to use the set STL container
instead. Additionaly, I want to im[pose a restriction (trait?/policy?)
that the elements of this set are derived from a particular base class Base
So, I want to be able to write something like this :
class RestrictedSet {
};
template <RestrictedSet T1, typename T2 ec=ZLIB, typename T3 cp=ADLER>
// <- this looks plain wrong !
class A {
};
For those who may be wondering what I'm up to.. I'm writing a class
template wrapper around a communication library. There are 1..N
(actually N = 5) possible transports that could be used at any one time.
I want to write a clas template which efectively acts as a class
factory, that allows nme to instantiate an object that is correctly set
up (as per my specifications) for communications.
The more I think of possible solutions, the more (unnecessarily?)
complicated it seems to get ... Help !
I want to be pass a list (1..N) of (different) types to a class template
- and I wonder if this can be done. Actually, because there are
different types, I think I will have to use the set STL container
instead. Additionaly, I want to im[pose a restriction (trait?/policy?)
that the elements of this set are derived from a particular base class Base
So, I want to be able to write something like this :
class RestrictedSet {
};
template <RestrictedSet T1, typename T2 ec=ZLIB, typename T3 cp=ADLER>
// <- this looks plain wrong !
class A {
};
For those who may be wondering what I'm up to.. I'm writing a class
template wrapper around a communication library. There are 1..N
(actually N = 5) possible transports that could be used at any one time.
I want to write a clas template which efectively acts as a class
factory, that allows nme to instantiate an object that is correctly set
up (as per my specifications) for communications.
The more I think of possible solutions, the more (unnecessarily?)
complicated it seems to get ... Help !