3 ms·
That's true! This is one of those instances of parallel evolution. The MSO construct predates even Boost's `enable_shared_from_this`, as I recall. FWIW when
by pianoben 7y ago
That's true! This is one of those instances of parallel evolution. The MSO construct predates even Boost's `enable_shared_from_this`, as I recall. FWIW when I was there, new code was encouraged to use STL smart pointers where possible - people were always looking for opportunities to shed legacy patterns where we could.
I totally agree about the danger of implicit conversion to raw pointers - it breaks the whole point of smart pointers. The reason it makes sense for Office is that huge swathes of code are written in "c++99" style - no exceptions, all functions return HRESULT error codes, and most functions are very explicit about who owns what. By convention, functions accepting pointers almost (?) never hang on to those pointers. Those functions that _do_ take ownership of (or retain an interest in) a pointer argument, explicitly ask for a smart pointer.
Like I said, not really suitable for general use, but darn convenient _within the context of Office_.