
Scott Meyers
I'll note that C++ itself allows "uninitialized" objects with constructors to be created all the time:
That doesn't make it a good practice and general, and...
std::ofstream ofs; std::vector<int>::iterator i;
...these two are examples (although at least the documentation about what that means is rigorous and complete)
std::string s;
...but this is not an example of it
In each case, there are a few operations that can legitimately be performed on such objects, but many operations lead to UB. Is this fundamentally different from the EventLog example? For example, replace EventLog in my example with ofstream, and you have
std::ofstream ofs; ofs << "Hello World";
Trouble ensues, just as it did in the EventLog example.
Yeah, nobody these days claims that the iostreams are an example of stellar, state-of-the-art C++ library design. -- Dave Abrahams Boost Consulting www.boost-consulting.com