Original Post
The question is in the code.
template<unsigned int SIZE>
class Vector {
public:
Vector () {
for (int i = 0; i < SIZE; ++i)
array = 0;
}
Vector (float f) {
for (int i = 0; i < SIZE; ++i)
array = f;
}
const float& operator[] (int index)) const {
return array[index];
};
float& operator[] (int index)) {
return array[index];
};
private:
float array[SIZE];
}
template<>
struct Vector<3> {
Vector (float x, float y, float z) {
array[0] = x;
array[1] = x;
array[2] = x;
}
// Is it possible to import the definitions of the
// unspecialised version of Vector<3> into this one?
// Or do I have to duplicate the code?
}