I have a function which looks like this
int myclass::setVersion(std::string ver)
{
if (ver.size()>1)
{
version.swap(ver)
return 0;
}
else
return -1;
}
My question is very simple, is it better to pass ver
the way it is or better to pass it as a pointer to string? FYI, ver
is a small size string (around 8).
EDIT: it does not matter if ver
is changed. I just want to replace version
with the contents of ver
. EDIT2: I am using visual studio 2008.