Vector access before empty check

Code reviewMedium20 min

Your task

Review this C++ function that returns the first element of a vector or a default.