Ok, so after fixing the code to:
Code:
template<typename T>
class MyArray
{
public:
MyArray();
//MyArray(MyArray& copy);
MyArray(const MyArray& copy);
MyArray& operator=(MyArray& copy);
};
class MyData
{
public:
//MyData(MyArray<int>& x, MyArray<int>& y);
MyData(const MyArray<int>& x, const MyArray<int>& y);
const MyArray<int>& x();
const MyArray<int>& y();
};
MyArray<int> read_data(int*, char**);
void make_changes(MyData* edit);
int main(int argc, char* argv[])
{
const MyArray<int> read_x = read_data(&argc, argv);
const MyArray<int> read_y = read_data(&argc, argv);
MyData user_data(read_x, read_y);
MyData edit_buffer(user_data);
make_changes(&edit_buffer);
}
I'm now getting:
Code:
coletek@spamisgood:~/sandbox/cc> g++ template_eg.cc -o template_eg
/tmp/ccwMgmQo.o: In function `main':
template_eg.cc:(.text+0x30): undefined reference to `read_data(int*, char**)'
template_eg.cc:(.text+0x48): undefined reference to `read_data(int*, char**)'
template_eg.cc:(.text+0x64): undefined reference to `MyData::MyData(MyArray<int> const&, MyArray<int> const&)'
template_eg.cc:(.text+0x70): undefined reference to `make_changes(MyData*)'
collect2: ld returned 1 exit status
Arrr... where I'm I going wrong?