Created
August 7, 2014 01:12
-
-
Save aryaxt/cc18c705602cf83c3ff1 to your computer and use it in GitHub Desktop.
An operator to log an object description only in debug mode
This file contains hidden or 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
operator postfix ^ {} | |
@postfix func ^ <T> (object: T?) -> T? { | |
#if DEBUG | |
println(object) | |
#endif | |
return object | |
} | |
// Usage | |
var someStirng = "dfgdfgdfgdfg" | |
someStirng^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment