pastebin

Paste Search Dynamic
Recent pastes
my map
  1. #include <string>
  2. #include <map>
  3. #include <iostream>
  4. #include <bits/stdc++.h>
  5.      
  6. int main()
  7. {
  8.     auto comp = [](const std::string& a, const std::string& b) { return a.length() < b.length(); };
  9.     std::map<std::string, std::string, decltype(comp)> my_map(comp);
  10.      
  11.     my_map["1"]      = "a";
  12.     my_map["three"]  = "b";
  13.     my_map["two"]    = "c";
  14.     my_map["fouuur"] = "d";
  15.      
  16.     for(auto const &kv : my_map)
  17.         std::cout << kv.first << std::endl;
  18.      
  19.     return 0;
  20. }
Parsed in 0.004 seconds