how to find via first value of set of pair in cpp

Revision en2, by anchal_vatre, 2020-05-29 14:50:21

for ex set<pair<string, int>> st; set.insert({"a", 1}); set.insert({"b", 1}); set.insert({"c", 1}); set.insert({"d", 1});

how to use find to get iterator on "b" ?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English anchal_vatre 2020-05-29 14:51:06 3
en2 English anchal_vatre 2020-05-29 14:50:21 0 (published)
en1 English anchal_vatre 2020-05-29 14:49:46 219 Initial revision (saved to drafts)