Random number in array

Why not make both functions templates? (or neither as in your second example)