As per standard, initialization of static members defined within function scope happens only once.
static std::ostream os = createStream( *this ); // initialized only once
Also, it is thread-safe if you are using C++11.
Pls have a look at these discussions:
1) thread safety of local static initialization in C++11.
2) Initialization of static variables.
If you are not using C++11 then operator() is not thread safe
static std::ostream os = createStream( *this ); // if not C++11, this is not thread-safe and must be guarded.