Last active
August 29, 2015 14:02
-
-
Save owensd/8337c84a1a7c6635f992 to your computer and use it in GitHub Desktop.
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
class MyDoubleDouble : FloatLiteralConvertible { | |
var double : Double | |
init(_ value: Double) { | |
double = value * 2 | |
} | |
class func convertFromFloatLiteral(value: Double) -> MyDoubleDouble { | |
return MyDoubleDouble(value) | |
} | |
} | |
let double = 2.0 // double has a value of 2.0 | |
let myDouble : MyDoubleDouble = 2.0 // myDouble.double has a value of 4.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment