Here's an interesting conundrum. Consider this simple test program
=================== snip =================
#ifdef IN_CLASS
# define MYCLASS(rtn) MyClass::##rtn
#else
# define MYCLASS(rtn) rtn
#endif
#include <stdio.h>
#ifdef IN_CLASS
class MyClass {
int aa;
public:
static int test(int a);
};
#endif
int MYCLASS(test)(int a)
{
// this isn't really going to do much
return a+a;
}
int main( int argc, char **argv ) {
printf("hello world\n");
MYCLASS(test)(2);
return 0;
}
=================== snip =================
If IN_CLASS is defined, the navigator shows test as part of MyClass.
If IN_CLASS is NOT defined, the navigator shows test as part of MyClass!
Is there any way to do this so the class doesn't show up in the
navigator if IN_CLASS is not defined? I have a "grown-up" project where
(a) the class doesn't appear in the left combo of the navigator bar and
(b) a whole bunch of MYCLASS methods appear in (Globals)
I tried
#ifdef IN_CLASS
int MyClass::test(int a)
#else
int test(int a)
#endif
{
// this isn't really going to do much
return a+a;
}
It might be that
#ifndef IN_CLASS
int test(int a)
#else
int MyClass::test(int a)
#endif
might be better..
ideas? or do I just have to live with it?
/steveA

Signature
Steve Alpert
my email Fgrir_Nycreg @ vqk.pbz is encrypted with ROT13 (www.rot13.org)
and spaces
Steve Alpert - 21 Oct 2004 15:55 GMT
A related question.
I have in my solution two projects. They use the some of the same
modules. One project has IN_CLASS defined and the other not. The
navigator is not-reponsive to class methods if I have the file open but
it's from the "wrong" project. Any sensible way to really "share" the
file in the IDE?
Steve Alpert
my email Fgrir_Nycreg @ vqk.pbz is encrypted with ROT13 (www.rot13.org)
and spaces