I understood that iterator helps up to iterates over the container. but what is that make the iterator for search() to work upon all the data type?
Iterator in the STL
@Vikaspal hey iterator is just a tool which is used to traverse the container just like the integer variable that you use in for loop to traverse array ,but iterator can be of any container type like for map you can take map iterator similiarly for vector ,also you can take auto vector ,so its just tool to traverse container .
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.