thanks you all folks, but i solved the question, is easy but repetitious, i need to make the operator<< to return an MyClass&, then i use this returned value to call the operator<< as many times as i want, like this:
Log& operator<<(const std::string& p){
std::lock_guard<std::mutex> locker(mutex);
std::cout << p;
return *this;
}
Log& operator<<(const std::string& p){
std::lock_guard<std::mutex> locker(mutex);
std::cout << p.c_str();
return *this;
}
But need to overload for any type that you want to use and them just create a global variable for it