Created
October 24, 2015 16:40
-
-
Save erynofwales/61768899502b7ac83c6e to your computer and use it in GitHub Desktop.
Error on line 23, pointing to the size() call: Cannot convert type 'Int' to expected argument type 'Int'
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
protocol Matrix { | |
typealias ElementType | |
static func dimensions() -> (rows: Int, cols: Int) | |
static func size() -> Int | |
init() | |
subscript(row: Int, col: Int) -> ElementType { get set } | |
} | |
struct Matrix4<T: FloatingPointType> : Matrix { | |
static func dimensions() -> (rows: Int, cols: Int) { | |
return (4, 4) | |
} | |
static func size() -> Int { | |
let dimensions = Matrix4.dimensions() | |
return dimensions.rows * dimensions.cols | |
} | |
private var data: [T] = [T](count: Matrix4.size(), repeatedValue: T(0)) | |
init() { | |
data = [T](count: Matrix4.size(), repeatedValue: T(0)) | |
} | |
subscript(row: Int, col: Int) -> T { | |
get { | |
} | |
set(value) { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That was supposed to be Matrix4 < T > .size()