Oh, of course you are right about that. I'll need to find another way to do this because when I originally tried writing the class _A so the constructor took an int as an argument the compiler didn't like that either:
class foo {
foo() {};
~foo() {};
A m(c);
}
User Profile
Collapse
-
-
error: ISO C++ forbids declaration of 'm' with no type
I suspect I don't understand namespaces or something, but does anyone have an idea of why the following code segment which is all in a single *.h file causes a compile error?
namespace first {typedef class _A {} //end namespace first
public:
_A() {};
~_A() {};
void set(int c) {b = c;};
int b;
} A;
namespace first {
namespace second {
namespace third ...
No activity results to display
Show More
Leave a comment: