The most flexible solution is to do both. E.g:
void setVertex(int x, int y, int z);
inline void setVertex(const Vertex &v)
{
setVertex(v.x, v.y, v.z);
}
Any modern compiler should trivially inline such a function. If your compiler cannot or will not inline such a function you're probably going to have a nightmare getting any kind of performance from it. TBH I would consider even the above a premature optimisation, I'd just use the setVertex(const Vertex &) as the definitive function until profiling indicated this was causing problems (which I highly doubt it will).
Especially considering the following is shorter without passing the struct.
[/quote]
This isn't much longer:
for(int x = -1 ; x <= 1 ; x += 2) {
for(int y = -1 ; y <= 1 ; y += 2) {
for(int z = -1 ; z <= 1 ; z += 2) {
setVertex(Vertex(v.x + x, v.y + y, v.z + z));
}
}
}