Hello,
I was hinted for my cause in using a mastertemplate. I did and I swear my little programm was up and running late night just the way I wanted it. This morning, however, I did some other corner stuff and now it does not compile anymore.. just like that... Have a look please...
#include <iostream>
class A
{
public:
A():x(0),y(0.0f){}
void Do(void);
template <class T1, class T2>
void Add (int a,
int b,
T1 *var1,
T2 *var2);
int x;
double y;
};
template <class T1, class T2>
void A::Add (int a,
int b,
T1 *passedVar1=T1(),
T2 *passedVar2=T2())
{
}
void A::Do(void)
{
Add(1,2, &x, &y); //works!
Add(1,2, &x); //error!
}
int main ()
{
A a;
a.Do();
}
Compiler Error@Code::Blocs 8.02
D:\C++ Projects\marc\console\main.cpp||In member function `void A ::Do()': |
D:\C++ Projects\marc\console\main.cpp|30|error: no matching function for call to `A::Add(int, int, int* )'|
||=== Build finished: 1 errors, 0 warnings ===|
I appreciate any help on that!
poliet