Add tools in order to compare types at compile time! And potentially at runtime
Example:
enum myEnum {
bob,
eq
}
var myEnum enumInst
// Safe unwrap (uses runtime checks
if (unwrap<enumInst, myEnum::bob> => unwrapped) {
}
// Unsafe unwrap (doesn't check anything)
if(unsafe_unwrap<enumInst, myEnum::bob> => unwrapped) {
}
var myEnum::bob test = unwrap<enumInst>
var myEnum::bob test2 = unwrap_unsafe<enumInst>
Furthermore, the unwrap and unsafe_unwrap operators can be used to directly extract the value. The unwrap operator will then cause a safety trap call
Add tools in order to compare types at compile time! And potentially at runtime
Example:
Furthermore, the
unwrapandunsafe_unwrapoperators can be used to directly extract the value. Theunwrapoperator will then cause a safety trap call