2 ms·
> Refcounted refs have copy and destruct semantics You're talking accross threads I believe. But accros scopes they are passed by reference I believe.
by didibus 6y ago
> Refcounted refs have copy and destruct semantics
You're talking accross threads I believe. But accros scopes they are passed by reference I believe.
- nikki93 6y agoI meant the copy semantics of the ref itself. The copy operation on a refcounted ref increments the refcount at the object it's referring to. The references themselves are values. Another way of looking at this--in C++ the copy constructor of std::shared_ptr. Move semantics as generally applied across values, when applied to such references, is what gives rise to the refcount elison stuff (the move constructor of std::shared_ptr does no increment).