3 ms·
> Like I realize some of it is modern C++ and maybe Microsoft was not focusing on desktop when C++ had these innovations This is basically it, I think; COM and
by pjc50 8y ago
> Like I realize some of it is modern C++ and maybe Microsoft was not focusing on desktop when C++ had these innovations
This is basically it, I think; COM and HANDLEs predate working standardised C++ compilers. MFC provides higher-level abstractions. Then everyone got distracted by managed runtimes. Finally C++ has a mostly-sane framework for universal usage of smart pointers, so this is bringing them back to the old Win32 era.
Unfortunately we can't get rid of wstring, but we can provide yet another layer of wrappers for it.
- cjfd 8y agoThis is a bit strange to me. It has been possible to write refcounted pointers in C++ since ages. And everybody has them in their own private library. Of Course, this introduces compatibility issues because everyone's smart pointer is different, so it is really nice that it eventually ended up in the standard library. However, it seems really hard to argue that it only now is possible to use smart points.
- nikbackm 8y agostd::unique_ptr was made possible first in C++11 thanks to move semantics. Same goes for the similar smart pointers in wil.
- munchbunny 8y agoAs the other response mentions, a lot of the win32 stuff predates C++11/0x. Also, a lot of the win32 stuff are C API's by design, not C++. If your question was "why wasn't a C++ wrapper released sooner?" I think the answer is ".NET". If your question was "why didn't the API's have C++ semantics?" I think the answer is "because a lot of it is C, not C++."
- MaxBarraclough 8y agoMicrosoft provides the 'CComPtr' class template, a ref-counting smart-pointer for COM. It's been around since very roughly the year 2000 [0] [1]. Boost's smart pointers have apparently [2] been around for about as long. If people have been rolling their own smart pointers since that time, isn't that their own fault? [0] https://docs.microsoft.com/en-us/cpp/atl/reference/ccomptr-class https://docs.microsoft.com/en-us/cpp/atl/reference/ccomptr-c... [1] https://en.wikipedia.org/wiki/Active_Template_Library#History https://en.wikipedia.org/wiki/Active_Template_Library#Histor... [2] https://www.boost.org/doc/libs/1_31_0/libs/smart_ptr/smart_ptr.htm https://www.boost.org/doc/libs/1_31_0/libs/smart_ptr/smart_p...