Source: https://www.cs.bham.ac.uk/~hxt/2015/c-plus-plus/stack.pdf