Is allocate a function or subroutine?

Your proposal would just be a particular case of that other one, actually.

You’re probably right in theory. In practice, though, I can see that the resizability feature of the C++ vectors is quite often used.