I'm making a logger. I want to create a function log() that takes a stream as input.
For instance:
log("hello"<<" "<<"world"<<10<<"\n"); I also want it to be thread safe.
I've redefined the << operator so I can do:
log()<<"hello"<<"world"<<10<<"\n" But this operation is not thread safe.
How can I make it thread safe?
--make-my-code-threadsafeoption to your compiler.