Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 #Define problem
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

LeeHickey
New Member

3 Posts

Posted - Nov 10 2005 :  12:36:43 PM  Show Profile
I've been having a problem with preprocessor expansion in both the latest beta, and the stable release. In each case, I have the "Evaluate all macros used in definitions" option enabled.

If you have code like this:

template <class T>
class Base
{
public:
static T* Get(){static T t; return &t;}
};

class Test : public Base<Test>
{
public:
void SomeFunc(){};
};

#define g_Test Test::Get()

then typing g_Test-> does not give any autocomplete options. I would expect it to offer me SomeFunc().

Oddly enough, it can 'sometimes' be coersed into working by modifying the #define as follows:

#define g_Test ((Test*)Test::Get())

but this only works maybe 50% of the time, and I haven't narrowed down why. I know it seems like a somewhat convoluted example, but I use a structure similar to this quite a lot for singleton classes etc.

=====================================================================
VA_X.dll file version 10.1.1430.0 built 2005.11.04
VAOpsWin.dll version 1.3.3.0
VATE.dll version 1.0.4.2
DevEnv.exe version 8.0.50215.44
msenv.dll version 8.0.50215.44
Font: Courier New 13(Pixels)
Comctl32.dll version 6.0.2900.2180
WindowsNT 5.1 Build 2600 Service Pack 2
Single processor

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Nov 10 2005 :  6:23:09 PM  Show Profile
case=874

when you say the more complex #define only works 50% of the time do you mean that for a given #define suggestions sometimes work and sometimes fail? or do you mean that it works for 50% of the #defines? in my limited tests this more complex form always works.

zen is the art of being at one with the two'ness
Go to Top of Page

LeeHickey
New Member

3 Posts

Posted - Nov 13 2005 :  11:35:26 AM  Show Profile
Hi,

I mean that it works for 50% of the cases, but the ones it works for it always seems to work.

I haven't managed to work out what, if any, differences exist between the examples that work and those that don't. I hope this helps track down the issue.

Regards,
Lee.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Nov 15 2005 :  5:19:59 PM  Show Profile
*ah* i have updated the case with this. thank you.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000