Test against the edge case when the vector is empty. Could be useful when std::max_element() is used form algorithm header and dereferencing its result could cause segmentation fault.
If iterative solution is used, when nothing is found then std::numeric_limits::min() may be returned if defined.
Similarly if max is initialized with the first element of a vector - SegFault.