4 ms·
if refcounting is gc, then c++ is a garbage collected language. It has std::shared_ptr
by vrighter 2mo ago
if refcounting is gc, then c++ is a garbage collected language. It has std::shared_ptr
- frollogaston 2mo agoRefcounting isn't GC, but also C++ isn't a refcounted language. You could spam shared_ptr everywhere, but it's not designed for that and probably wouldn't be performant. And because of that, realistically all your libs take raw pointers, so you still have to unwrap your shared_ptrs then be back to managing ownership. Swift has refcounting built into the language and assumed everywhere. You could always use raw refs in Swift, but that's not the norm.
- worik 2mo agoNo E.g. in Swift the reference counting is automatic a d implicit In C++ it is manual and explicit