Created
June 8, 2014 03:11
-
-
Save jweinberg/f8a85ff28de2bfd82343 to your computer and use it in GitHub Desktop.
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
protocol Initializeable { | |
init() | |
} | |
extension Array: Initializeable {} | |
func create<T: Initializeable>(t: T.Type) -> T { | |
return t() | |
} | |
var s = create(Array<Int>) | |
println(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment