References are essentially just memory addresses pointing to some location in memory, but the C++ language treats them as if they were the object they are pointing to – it handles the indirection – making them perfect aliases for objects.

A while ago a guy I know was working on a program that involved a large number of “jobs” read from a file/database. The issue he had was that he wanted different “views” of those jobs – for example, he wanted a view of the jobs sorted by job ID, another of the jobs sorted by start/end time, another sorted by priority, and so on. Continue Reading