Closed Amleto closed 8 years ago
The implicit copy constructor of Json
will copy the shared_ptr
, thus making a shallow copy of the object (increasing the refcount). This is safe since the underlying objects are immutable; the intention was to make Json
a lightweight handle-like type.
Json::m_ptr
looks likestd::unique_ptr
would be more suited? I didn't see any sharing that suggestsshared_ptr
is needed, but only eye-balled it.