fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <map>
  4. #include <initializer_list>
  5.  
  6. #define map_entries_begin {
  7. #define map_entries_end }
  8. #define map_entry_begin {
  9. #define map_entry_end },
  10.  
  11. const std::map<int, std::map<int, std::string>> test =
  12. map_entries_begin
  13. //------//
  14. map_entry_begin
  15. 1, map_entries_begin
  16. map_entry_begin 1, "bla" map_entry_end
  17. map_entry_begin 2, "blie" map_entry_end
  18. map_entries_end
  19. map_entry_end
  20.  
  21. //------//
  22. map_entry_begin
  23. 3, map_entries_begin
  24. map_entry_begin 1, "ha" map_entry_end
  25. map_entry_begin 2, "hie" map_entry_end
  26. map_entries_end
  27. map_entry_end
  28.  
  29. map_entries_end;
  30.  
  31. int main()
  32. {
  33. std::cout << test.find(3)->second.find(2)->second << "\n";
  34. return 0;
  35. }
Success #stdin #stdout 0s 3068KB
stdin
Standard input is empty
stdout
hie