[=] memory management with weak_ptrs