What will be good programming practice out of two below funcs:
This:
std::string buildvalue(const std::string &in) { std::string out; out = // Do some calulation bases on input return out; }
Or this:
void buildvalue(const std::string &in, std::string &out) { out = // Do some calulation bases on input }
Cautious with 2 function is that the caller may pass non-empty string. Is there any points to note.