How do I go about writing a function which takes an object of a template class as a parameter? Would the following work? And can it go in the .cpp file instead of a header? (I have only written templated classes before).
template<class T> class LtdArray {
//class definition
}
template<class T> class LtdArray
bool ifBlockProcess(LtdArray <darr, string strToProc) {
//add element to LtdArray
}
When making function templates, you don’t need to include the class. Your prototype should look like this: