I have seen problems with VAX for some time if I use macros within declarations (tested with VC6 SP5 and VAX 1649 / 1711).
In the application I am working on macros like S_TEXTVAX_2 are used frequently and I am so dependent on VAX that I would like to see it working for this macros too.
I have produced some test code to find out where the problem could be but have not found anything conclusive.
All macros except for S_VAXTEST_2 are just attempts to see whether VAX can handle them or not.
VAX is not recognizing the variables aObjects4/6 at all (fine for me).
The VAX intellisense gives the following results if I place the caret after the closing square bracket for the following variables:
aObjects1[j] S_VaxObject& operator [] (size_t)
aObjects2[j] T& operator [] (size_t)
aObjects3[j] T& operator [] (size_t)
aObjects5[j] S_TESTVAX_5(aObjects5)
The intellisense for the .cStr() is working for aObjects1 and aObjects5 and shows me "const char *cStr() const". Intellisense for .cStr() is not working for aObjects2 and aObjects3.
The get() method shows the same problems as the operator [].
I hope that my posting is not too confusing.
Cheers,
Jochen.
// Begin code
class S_VaxObject
{
public:
S_VaxObject();
~S_VaxObject();
const char *cStr() const;
};
template <class T, class Order>
class S_VaxArray;
template <class T>
class S_VaxOrder
{
public:
S_VaxOrder();
~S_VaxOrder();
};
template <class T, class Order>
class S_VaxIter
{
public:
S_VaxIter (S_VaxArray<T,Order>&);
~S_VaxIter ();
};
template <class T, class Order>
class S_VaxArray
{
friend class S_VaxIter<T,Order>;
public:
S_VaxArray();
virtual ~S_VaxArray();
T& operator [] (size_t);
T get();
size_t length() const;
};
#define S_TESTVAX_2(TN) S_VaxArray < TN , S_VaxOrder < TN > >
#define S_TESTVAX_3 S_VaxArray < S_VaxObject , S_VaxOrder < S_VaxObject > >
#define S_TESTVAX_4 S_VaxObject aObjects4[100]
#define S_TESTVAX_5(N) S_VaxObject N[100]
#define S_TESTVAX_6A(T) T
#define S_TESTVAX_6B(N) N[100]
void VAX_test()
{
S_VaxArray< S_VaxObject, S_VaxOrder<S_VaxObject> > aObjects1;
S_TESTVAX_2( S_VaxObject ) aObjects2;
S_TESTVAX_3 aObjects3;
S_TESTVAX_4;
S_TESTVAX_5(aObjects5);
S_TESTVAX_6A(S_VaxObject) S_TESTVAX_6B(aObjects6);
size_t j;
for(j=0; j<aObjects1.length(); j++)
{
aObjects1[j].cStr();
aObjects2[j].cStr();
aObjects3[j].cStr();
aObjects4[j].cStr();
aObjects5[j].cStr();
aObjects6[j].cStr();
aObjects1.length();
aObjects2.length();
aObjects3.length();
aObjects1.get().cStr();
aObjects2.get().cStr();
}
}
// End code