Last active
August 29, 2015 14:04
-
-
Save memfrag/fd96cf1729001a3942a7 to your computer and use it in GitHub Desktop.
[Swift] Custom Assignment Operator
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
operator infix <- {} | |
infix func <- <T>(inout left: T, right: T) { | |
left = right | |
} | |
var value = 0 // Initialize | |
value <- 1337 | |
// value now contains 1337 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment