mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:07:35 +00:00
AK: Return non-const types from Ptr class operators
Even if the pointer value is const, the value they point to is not necessarily const, so these functions should not add the qualifier. This also removes the redundant non-const implementations of these operators.
This commit is contained in:
parent
24caacfe28
commit
3483407ddc
5 changed files with 23 additions and 85 deletions
|
@ -117,10 +117,8 @@ public:
|
|||
}
|
||||
|
||||
T* ptr() const { return unsafe_ptr(); }
|
||||
T* operator->() { return unsafe_ptr(); }
|
||||
const T* operator->() const { return unsafe_ptr(); }
|
||||
operator const T*() const { return unsafe_ptr(); }
|
||||
operator T*() { return unsafe_ptr(); }
|
||||
T* operator->() const { return unsafe_ptr(); }
|
||||
operator T*() const { return unsafe_ptr(); }
|
||||
|
||||
[[nodiscard]] T* unsafe_ptr() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue