|
|
|
|
|
by o11c
875 days ago
|
|
A useful way to think of this kind of thing is to hoist the assertions into the caller, where they can be optimized out. There's a lot of poorly-explored room in compiler design to take generalized invariants/preconditions/postconditions into consideration (explicit ones are useful for opaque functions defined in a different TU), not just things considered "types" (the problem with types is that they have different lifetime/allocation concerns than assertions). |
|