I am storing a weak_ptr
for avoiding circular structure, and I know that in some particular context the shared_ptr
is still valid.
Can I get the raw pointer from weak_ptr
without casting to shared_ptr
(which involves memory write)?
(note: this is not a duplicate of How to maintain a weak pointer to a parent in C++?, I am specifically asking about an unsafe way, not about getting the pointer as such)