[tuple] weird compile error with VC-8_0

Hi, I am getting this error message, when using boost::tuple: include\boost\tuple\detail\tuple_basic.hpp(373) : error C2039: 'tail' : is not a member of 'boost::tuples::cons<HT,TT>' 1> with 1> [ 1> HT=UTX::DB::nulled_type<unsigned char>, 1> TT=boost::tuples::null_type 1> ] The referred line is the templated constructor of the non-specialised struct cons: template <class HT2, class TT2> cons( const cons<HT2, TT2>& u ) : head(u.head), tail(u.tail) {} So it seems that somehow the non-specialised method is called for the specialised template instantiation. Has anybody seen something like this? Is there a way to circumvent it? Thx ImRe

<imre@u-tx.com> wrote in message news:20060907060211.DFA9D1054D4@wowbagger.osl.iu.edu...
Hi,
I am getting this error message, when using boost::tuple:
include\boost\tuple\detail\tuple_basic.hpp(373) : error C2039: 'tail' : is not a member of 'boost::tuples::cons<HT,TT>' 1> with 1> [ 1> HT=UTX::DB::nulled_type<unsigned char>, 1> TT=boost::tuples::null_type 1> ]
The referred line is the templated constructor of the non-specialised struct cons:
template <class HT2, class TT2> cons( const cons<HT2, TT2>& u ) : head(u.head), tail(u.tail) {}
So it seems that somehow the non-specialised method is called for the specialised template instantiation. Has anybody seen something like this?
Yes.
Is there a way to circumvent it?
With me it happened because the compiler was instantiating (unintended) stuff where the tuple was too short. You could try using enable_if on a very general signature instead of specialisation to prevent the compiler 'looking into' stuff. IOW Before: template <int N> struct my; template <> struct my<1>{...}; After: template <int N, typename Enable = void> struct my; // <--- for boost::enable_if template <int N> struct my <N, typename boost::enable_if_c<(N==1) >::type> {...}; HTH regards Andy Little
participants (2)
-
Andy Little
-
imre@u-tx.com