I have a method to log with the following definition:
void log(std::string s) {
std::string tag = "main";
std::cout << tag << " :" << s << std::endl;
}
I'm trying to call this method like this:
log("direction" << std::to_string(direction) << ", count: " << std::to_string(count));
direction
and count
are integers.
I'm getting this following error with <<
underlined in red:
no operator << matches these operands. operand types are const char [10] << std::string
I have #include<string>
in my header to make sure my strings are working as they should.
I tried std::string("direction")
and still the issue was same.
Beginner in C++. Help would be appreciated.