Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

get map element from iterator c++

// Single line to get the pair: 
std::pair<key_t, value_t> pair = *std::next(map.begin(), at);
// To get the iterator:
auto itr = std::next(map.begin(), at);
Source by en.cppreference.com #
 
PREVIOUS NEXT
Tagged: #map #element #iterator
ADD COMMENT
Topic
Name
4+9 =