J
Joe
Shouldn't I be able to use a friend function like below? I'm getting
the following compiler errors in XCode 3 …
'test' was not declared in this scope
'double AB::test(double, double)' should have been declared inside 'AB'
Seems like this might have something to do w/ my namespaces. I've tried
to include everything I thought relevant to this problem.
--- BN.h ---
namespace AB {
class BN
{
public:
friend double test(double a, double b);
};
}
--- BN.cc ---
// error on next line … 'double AB::test(double, double)' should have
been declared inside 'AB'
double AB::test(double a, double b)
{
return
};
--- AL.h ---
namespace AB {
class AL : public BL
{
public:
AL();
};
}
--- AL.cc ---
using namespace std;
// constructor
AB::AL::AL() : BL() {
// error on next line … 'test' was not declared in this scope
test();
};
In case the above looks strange, I've double checked for any typos, and
it's all right (left out forward declarations, headers, etc...). This
used to compile in XCode 2.
the following compiler errors in XCode 3 …
'test' was not declared in this scope
'double AB::test(double, double)' should have been declared inside 'AB'
Seems like this might have something to do w/ my namespaces. I've tried
to include everything I thought relevant to this problem.
--- BN.h ---
namespace AB {
class BN
{
public:
friend double test(double a, double b);
};
}
--- BN.cc ---
// error on next line … 'double AB::test(double, double)' should have
been declared inside 'AB'
double AB::test(double a, double b)
{
return
};
--- AL.h ---
namespace AB {
class AL : public BL
{
public:
AL();
};
}
--- AL.cc ---
using namespace std;
// constructor
AB::AL::AL() : BL() {
// error on next line … 'test' was not declared in this scope
test();
};
In case the above looks strange, I've double checked for any typos, and
it's all right (left out forward declarations, headers, etc...). This
used to compile in XCode 2.