Initial Commit
This commit is contained in:
1625 files changed
+43221
No files matched your search
@@ -0,0 +1,21 @@
|
||||
#! @file faults.sakura
|
||||
#! @author John Christman (sorakatadzuma@gmail.com)
|
||||
#! @copyright Malunal Studios, LLC.
|
||||
#! @license MIT
|
||||
#!
|
||||
#! Contains the fault std's containers stop with where they are asked for an
|
||||
#! element they do not hold, which no switch leaves out, as `core`'s own
|
||||
#! containers have.
|
||||
|
||||
module std::containers;
|
||||
|
||||
|
||||
# Stops the program where one of std's containers is asked for an element past
|
||||
# its end, as indexing a view outside its length does. A container calls it
|
||||
# only where its check fails, so that where the check holds, it costs a compare,
|
||||
# and the call is no more than its two numbers, which keeps what calls it short
|
||||
# enough to be emitted where it is called. Where the check is, and what called
|
||||
# it, the report of the stop names.
|
||||
def past_end(index: u64, length: u64): void {
|
||||
fault($"Index {index} is out of bounds: the length is {length}.");
|
||||
}
|
||||
Reference in new issue
Block a user