Created
December 10, 2014 22:53
-
-
Save bkase/8afc20abbbe5730b8b3a to your computer and use it in GitHub Desktop.
Assertion code in swift std library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// User code assertions. | |
/// | |
/// User code assertions and fatal errors are only enabled in debug mode. In | |
/// release or fast mode these checks are disabled. This means they may have no | |
/// effect on program semantics, depending on the assert configuration. | |
/// Traditional C-style assert with an optional message. | |
/// | |
/// When assertions are enabled and `condition` is false, stop program | |
/// execution in a debuggable state after printing a message. When | |
/// assertions are disabled in release and fast builds, `condition` is not even | |
/// evaluated. | |
/// | |
/// When assertions are turned off, the optimizer can assume that the | |
/// `condition` is true. | |
func assert(condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String = default, file: StaticString = default, line: UWord = default) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment