mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-14 01:04:38 +03:00
19d9d5bfe1
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. |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
GraphWidget.cpp | ||
GraphWidget.h | ||
main.cpp | ||
MemoryStatsWidget.cpp | ||
MemoryStatsWidget.h | ||
NetworkStatisticsWidget.cpp | ||
NetworkStatisticsWidget.h | ||
ProcessFileDescriptorMapWidget.cpp | ||
ProcessFileDescriptorMapWidget.h | ||
ProcessMemoryMapWidget.cpp | ||
ProcessMemoryMapWidget.h | ||
ProcessModel.cpp | ||
ProcessModel.h | ||
ProcessStateWidget.cpp | ||
ProcessStateWidget.h | ||
ProcessUnveiledPathsWidget.cpp | ||
ProcessUnveiledPathsWidget.h | ||
ThreadStackWidget.cpp | ||
ThreadStackWidget.h |