Original Post
Hi all. I am trying to create a logger for my game engine but have some problems with it. Consider the following code: This is all dandy and good, but if I change the line with "Something to log" to something like this: log << "Something " << "to log"; I get an error, "error: void value not ignored as it ought to be", on that line! How can I make my logger accept multiple strings? (And other types like doubles, and ints?) P.S. Google wasnt too helpfull! Does someone know how, if possible, to search for special characters with Google? (Like the "<"s in c++ "operator <<")
class CLogger {
void operator <<(std::string s) {
cout << "Logging this: " << s << endl;
}
};
int main(void) {
CLogger log;
log << "Something to log";
}