If you could make it a compile-time option to disable the unchecked() keyword from having any effect, it'd be great.
This way, you'll still need to USE unchecked(), which the language designers want.
But you'll ALSO get to disable it if you're trying to debug a crash, or in debug mode, or whenever you want, without modifying your actual code.
Maybe call it, "force bounds checks" or something.
In my case, it shaves about 5-10ms off my frame times to use unchecked(), bringing them from ~20 to ~10ms, which is kind of a big deal when you have to hit 60fps. So I'm not going to not use unchecked generally. But I'd like to be able to choose to not use it sometimes for troubleshooting.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in one week if no further activity occurs. Thank you for your contributions!
If you could make it a compile-time option to disable the unchecked() keyword from having any effect, it'd be great.
This way, you'll still need to USE unchecked(), which the language designers want.
But you'll ALSO get to disable it if you're trying to debug a crash, or in debug mode, or whenever you want, without modifying your actual code.
Maybe call it, "force bounds checks" or something.
In my case, it shaves about 5-10ms off my frame times to use unchecked(), bringing them from ~20 to ~10ms, which is kind of a big deal when you have to hit 60fps. So I'm not going to not use unchecked generally. But I'd like to be able to choose to not use it sometimes for troubleshooting.
Thanks!