1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00
ladybird/Userland
creator1creeper1 19d9d5bfe1 Everywhere: Mark Vector of mutable references as mutable
The point of a reference type is to behave just like the referred-to
type. So, a Foo& should behave just like a Foo.

In these cases, we had a const Vector. If it was a const Vector of Foo,
iterating over the Vector would only permit taking const references to
the individual Foos.

However, we had a const Vector of Foo&. The behavior should not
change. We should still only be permitted to take const references to
the individual Foos. Otherwise, we would be allowed to mutate the
individual Foos, which would mutate the elements of the const Vector.
This wouldn't modify the stored pointers, but it would modify the
objects that the references refer to. Since references should be
transparent, this should not be legal.

So it should be impossible to get mutable references into a const
Vector. Since we need mutable references in these cases to call the
mutating member functions, we need to mark the Vector as mutable as
well.
2022-01-16 00:38:21 +03:30
..
Applets LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServer 2022-01-15 13:29:48 +03:30
Applications Everywhere: Mark Vector of mutable references as mutable 2022-01-16 00:38:21 +03:30
Demos Everywhere: Fix spelling mistakes 2022-01-07 15:44:42 +01:00
DevTools LibCore+LibIPC+Everywhere: Return Stream::LocalSocket from LocalServer 2022-01-15 13:29:48 +03:30
DynamicLoader Toolchain+Meta: Update LLVM version to 13.0.0 2021-10-17 17:09:58 +01:00
Games Snake: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
Libraries LibJS: Implement Date.prototype.getTimezoneOffset 2022-01-15 20:13:48 +01:00
Services Everywhere: Mark Vector of mutable references as mutable 2022-01-16 00:38:21 +03:30
Shell Shell: Add a "noop" builtin aliased to ":" 2022-01-09 12:25:36 +01:00
Utilities nc: Port to LibMain 2022-01-15 22:01:07 +01:00
CMakeLists.txt