template<typename _Ty>
class ax::WeakPtr< _Ty >
WeakPtr.
A non-owning smart pointer to an ax::Object. Unlike RefPtr, it does not increase the reference count. It becomes expired when the target Object is destroyed or recycled.
Key points:
- Use expired() to check if the pointer has expired.
- Use lock() to obtain a RefPtr if the object is still alive.
- Supports comparison with raw pointers and nullptr for convenience.
- Does not guarantee thread safety (same as ax::Object reference counting).
Typical usage:
- Store a WeakPtr when you need to reference an Object without extending its lifetime.
- Always check expired() before dereferencing or locking.