std::unordered_map iterator

Hello Forum,

I have an "unordered_map" variable. I use its function "find()". I want to put its return value into another variable.

1
2
3
  std::unordered_map<DWORD, std::string> map;

std::_List_const_iterator<std::_List_val<std::_List_simple_types<std::pair<unsigned long const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > i = map.find(SomeValue);


That is a very long unreadable definition of "i". Is there another way to define the variable "i"? Without "auto".

Thank you.


You can find the return type of the standard library functions on a reference page of your choice. cppreference has a deservedly good reputation:

https://en.cppreference.com/w/cpp/container/unordered_map/find


Hello,

I found the following method:

std::unordered_map<DWORD, std::string>::const_iterator i;

Thank you.
Topic archived. No new replies allowed.