Boost logo

Boost :

From: Sofus Mortensen (sofus_at_[hidden])
Date: 2000-10-02 16:50:49


Hi,

I have constructed a ISREF that works fine with VC7 (beta version), but
fails with INTERNAL COMPILER ERROR on VC6.
Maybe someone has a suggestion to how to make it work with VC6?

template<typename T> struct Holder { T x; Holder(); };

template<typename T>
char IsRef( Holder<T&>* );
int IsRef(...);

template<class T>
struct ISREF {
  static Holder<T>* x;
  enum { RET = sizeof(IsRef( x ) ) == 1};
};

char a1[ISREF<int&>::RET];
char b1[!ISREF<int>::RET];
char c1[!ISREF<int*>::RET];
char d1[!ISREF<int* const>::RET];
char e1[ISREF<const int&>::RET];
char f1[!ISREF<const int>::RET];
char g1[!ISREF<const int*>::RET];
char h1[!ISREF<const int* const>::RET];
char i1[ISREF<const volatile int&>::RET];
char j1[!ISREF<const volatile int>::RET];
char k1[!ISREF<const volatile int*>::RET];
char l1[!ISREF<const volatile int* const>::RET];

Best regards,

Sofus Mortensen

tlb2h - A COM/C++ interoperability tool
http://www.lambdasoft.dk/tlb2h


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk