Dear all,
I am trying to use the template template parameters, and I am stuck on a code that does not compile, I do not know why.
Here is how I declare my class with template template parameter:
1 2 3 4 5 6 7 8
|
template<class T, template<class U> class OP>
class Component
{
public:
// ... several methods ...
XYZCoord innExtr()
std::set<int> addPointCheckTouchs(XYZCoord p, DistributedDataStruct<T>* labl);
};
|
where [XYZCoord] and [DistributedDataStruct<T>] are previously defined classes.
Here is how I define and implement the method [addPointCheckTouchs]:
1 2 3 4 5
|
template<class T, template<class U> class OP>
std::set<int> Component<T,OP>::addPointCheckTouchs(XYZCoord p, DistributedDataStruct<T>* labl)
{
//..implementation...
}
|
Here is how I call the concerned method in the main().
The last line is the one that does not compile
1 2 3 4 5 6 7 8
|
// .. instructions ..
std::vector<Component<unsigned short, Minimal > > vconn; //Minimal is a previously defined template
// .. instructions ..
XYZCoord vx0 = vconn[0].outExtr();
vconn[0].addPointCheckTouchs<unsigned short, Minimal>(vx0, labl);
|
I have tried to omit "<unsigned short, Minimal>", I get another error message, which is the following:
note: candidates are: std::set<int, std::less<int>, std::allocator<int> > Component<T, OP>::addPointCheckTouchs(XYZCoord, DistributedDataStruct<T>*) [with T = short unsigned int, OP = Minimal]
which is strange, as it is exactly how I define my method.
Maybe someone more expert than me could figure out what I am mising in that code.
I thank you all,
Panecasareccio