You’re making this way more complicated than it needs to be.
std::to_string
is a function. Just a function. It’s taking an int
and giving back a std::string
.
Here’s another function:
void foo()
{
// hello!
}
You don’t need to make functions be member functions. C++ isn’t just an object-oriented language.