why did bhaiya write
template<class forwarditerator, class T >
before the function search() in the example of iterator?
please explain in detail what exactly the above code is doing.
why did bhaiya write
template<class forwarditerator, class T >
before the function search() in the example of iterator?
please explain in detail what exactly the above code is doing.
he is making template
function
template functions are used when u need to change the datatype of variable at different point in times
For example, a software company may need sort() for different data types. Rather than writing and maintaining the multiple codes, we can write one sort() and pass data type as a parameter.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.