When the c++ compiler generates very similar assembler code for a reference and pointer, why is using references preferred (and considered safer) compared to pointers?
Because references (which are simply an alias for other variable) can't be NULL by definition, providing an inherent layer of safety.
NULL