I've got a following function template:
template<class A, class C, class B>
A doFoo(const B &val)
{
//do something with C
}
Within my cpp file, all doFoo function will be used with one type for C. Is it possible to do such kind of typedef:
typedef myDoFoo<A, B> doFoo<A, ParticularC, B>
If it is - what is a correct syntax to do this?
Just define another template function:
template<class A, class B>
A myDoFoo(const B &val)
{
return doFoo<A,ParticularC,B>( val );
}
You may write a function:
template<class A, class B>
A myDoFoo(const B &val)
{
return doFoo<A, ParticularC, B>(val);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With