I\'m a little lost in how to cast templates. I have a function foo which takes a parameter of type ParamVector
. I would like to pass in a P
You can't cast templates like this because the types are unrelated.
However, you can add a conversion function, such as:
(Your code wasn't really complete, so I can post complete code either. Hopefully you will get the idea.)
template class ParamVectorConsumer
{
public:
ParamVector test;
template ParamVectorConsumer convert()
{
ParamVectorConsumer ret;
ret = this->...
}