| ▲ | archargelod 2 days ago | |
Is there any way in Go to selectively turn off bounds checking for a block, function or module? E.g. in Nim I can just do:
And GCC is smart enough to reduce it to a single operation: | ||
| ▲ | win311fwg 2 days ago | parent [-] | |
There is nothing in the language spec. It leaves it up to the implementation to decide how to optimize. Whether or not your implementation has an extension to perform the same will ultimately depend on the implementation you are using, although you are unlikely to find it in any of the popular implementations. | ||