I want to use std::vector for dynamically allocating memory. The scenario is:
int neededLength = computeLength(); // some logic here // this will allocate t
Well, you can remove one set of parens:
&buffer[0]
but that is the common, idiomatic way of doing it. If it really offends you, I suppose you could use a template - something like:
template T * StartOf( std::vector & v ) { return &v[0]; }