Anonymous
8/23/2025, 7:18:05 PM
No.106359555
>>106359499
Are you sure about that? I would think that the invariants only have to be expressed when it's a something public facing - internal functions should be free to assume invariants just fine
When you call get() on a vec or similar that function doesn't need to make sure that the internal pointer to the data is valid, all you're doing is verifying the bounds of what you pass in.
To put it another way, you're not constantly making sure that your pointers aren't null - you just make sure that they're correctly set when they are
Are you sure about that? I would think that the invariants only have to be expressed when it's a something public facing - internal functions should be free to assume invariants just fine
When you call get() on a vec or similar that function doesn't need to make sure that the internal pointer to the data is valid, all you're doing is verifying the bounds of what you pass in.
To put it another way, you're not constantly making sure that your pointers aren't null - you just make sure that they're correctly set when they are