A
Alfonso Morra
I have some code that I am porting over from C. It is full of static
functions and global variables. I have got around this by wrapping most
of the code in a singleton object.
However, I am findng that in my method definitions, I am having to fully
scope the names of any other functions I am calling. I do not understand
this. The clas declaration code look some thing like this:
class A: public Singleton<A> {
public:
A();
~A() ;
private:
A (const A&)
struct1 x ;
int b ;
........
foo1() ;
foo2() ;
};
The implementation looks like this:
A::foo1() {
foo2() ; // <- compiler coplains here (dosent know about fo2
....
}
The actual compiler error msg is:
error C3861: 'foo2': identifier not found, even with argument-dependent
lookup.
However, this works:
A::foo1() {
A::foo2() ; // <- compiler coplains here (dosent know about fo2
....
}
Why?. I have never had to explicitly name functions before, and these
are uniquely named functions. Thanks
functions and global variables. I have got around this by wrapping most
of the code in a singleton object.
However, I am findng that in my method definitions, I am having to fully
scope the names of any other functions I am calling. I do not understand
this. The clas declaration code look some thing like this:
class A: public Singleton<A> {
public:
A();
~A() ;
private:
A (const A&)
struct1 x ;
int b ;
........
foo1() ;
foo2() ;
};
The implementation looks like this:
A::foo1() {
foo2() ; // <- compiler coplains here (dosent know about fo2
....
}
The actual compiler error msg is:
error C3861: 'foo2': identifier not found, even with argument-dependent
lookup.
However, this works:
A::foo1() {
A::foo2() ; // <- compiler coplains here (dosent know about fo2
....
}
Why?. I have never had to explicitly name functions before, and these
are uniquely named functions. Thanks