fork(6) download
  1. #include <iostream>
  2. #include <functional>
  3. #include <map>
  4. using namespace std;
  5.  
  6. int main() {
  7. map<int, float, greater<int>> example;
  8. example.emplace(std::make_pair(10, 10.0));
  9. example.emplace(std::make_pair(12, 12.0));
  10.  
  11. for (auto const& entry : example)
  12. {
  13. cout << "Key: " << entry.first << " " << entry.second << endl;
  14. }
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 3476KB
stdin
Standard input is empty
stdout
Key: 12 12
Key: 10 10