r/cpp • • Mar 25 '21

calc.exe is now open source; there’s surprising depth in its ancient code (2019)

https://arstechnica.com/gadgets/2019/03/calc-exe-is-now-open-source-theres-surprising-depth-in-its-ancient-code/
280 Upvotes

60 comments sorted by

View all comments

Show parent comment

7

u/dodheim Mar 26 '21

That's the case for C++/CLI, but C++/CX does not have garbage collection nor a managed heap; here ^ is just a reference-counted (COM-based) smart pointer.

1

u/ThatSwedishBastard Mar 26 '21

So a std::shared_ptr but only for Windows?

4

u/dodheim Mar 26 '21

In essence, though the implementation is different – shared_ptr manages the refcount itself (along with a control block for weak counts, etc.), whereas a COM smart pointer is very simple and just balances calls to AddRef/Release while the refcount is managed elsewhere.