How does a List know that you changed it while enumerating it?
Everyone falls for that and tries to change a list while enumerating it greeted by the System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
message. But how does the List
know that you changed it? Let's find out.