I learned from this post here to create helper functions in the namespace.
'Helpers' in C ++
namespace utility{
static std::string intToString(int integer)
{
std::stringstream sstream;
sstream << integer;
return sstream.str();
}
static void toLowerCase(std::string& y)
{
std::transform(y.begin(), y.end(), y.begin(), (int(*)(int))tolower);
}
}
I include this header, but I received the following warning
'void utility::toLowerCase(std::string&)' defined but not used
Yes. I used intToString (int integer), but not toLowerCase (std :: string &). I do not want to see these warnings or divide one helper function into a header.
Can anyone suggest a good solution? Should I just turn off the warning? Thanks you
source
share