I am mainly a C developer, but starting to use C++ more and more.
I have a templated function below which will search for values in STL containers of different types and do some processing.
I understand that the compiler will generate different functions depending on which data types are passed.
How do I determine the element type here in my situation? I can't use auto because my code should be compiled without the C++11 flag.
template <typename T, typename T_it>
void ProcessContainer(T con, T_it it )
{
typename N;
for (it = con.begin(); it != con.end(); ++it )
{
//auto element = *it; - Can't use auto in my case
// other processing.. not included
}
}