3 ms·
Any language can implement safe vector / array accessing with a `get` call returning either a sum type of throwing an exception when the element does not exist
by selfmodruntime 4y ago
Any language can implement safe vector / array accessing with a `get` call returning either a sum type of throwing an exception when the element does not exist at the index.
Quite frankly, manually indexing into an array should be entirely avoided if possible, even more so with safety critical software.