Commit graph

4 commits

Author SHA1 Message Date
Jonne Ransijn
6d1fa64f5f AK: Allow NonnullRawPtr to be used in constant expressions 2024-12-04 16:45:58 +00:00
Jonne Ransijn
b7e22f0916 AK: Disallow creating NonnullRawPtrs from r-value references
This would always result in a use-after-free.
2024-12-04 16:45:58 +00:00
Jonne Ransijn
bea602f5ed AK: Use Noncopyable.h in NonnullRawPtr 2024-12-04 16:45:58 +00:00
Jonne Ransijn
e50b9f5478 AK: Add NonnullRawPtr<T> abstraction
It is a non-null `T*` with reference semantics.
Or a `T&` whose address can be copied and re-assigned.
Or a `NonnullRefPtr` whose memory is not managed.

It can be useful when you want to store a reference in a
data structure that needs to be copyable or assignable.
2024-11-06 09:43:15 +00:00