Skip to content

Instantly share code, notes, and snippets.

@nmarley
Created July 5, 2018 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmarley/c28de321bd15d1205900b1cf9d595d2e to your computer and use it in GitHub Desktop.
Save nmarley/c28de321bd15d1205900b1cf9d595d2e to your computer and use it in GitHub Desktop.
C++ -- output of modifying map in range-based for
$ git log -1 --oneline
f255aad (HEAD -> master, origin/master) add separator to break up output
$ g++ -std=c++11 range-for-modify.cpp
$ ./a.out
added = 1
added = 0
key = [2], value = [two]
key = [5], value = [five]
key = [7], value = [seven]
key = [13], value = [thirteen]
key = [21], value = [twenty-one]
=================================
key = [2], value = [two]
key = [5], value = [five]
key = [7], value = [seven]
key = [13], value = [thirteen]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment