cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

drstrip
Journeyman III

template specialization failure in VS2008, but OK in 2005

The following subkernel compiles correctly in VS2005, but fails in VS2008

kernel uint4 compareToNeighbor(uint4 new_spin<>, uint4 neighbor<>)
{
  return (uint4)(((int4) new_spin != (int4) neighbor) & int4(1,1,1,1));
}

The error in VS2008 is -

1>c:/Users/drstrip/Documents/Visual Studio 2008/Projects/PotsModel/pots.br(8) : error C2893: Failed to specialize function template 'vec::type,LUB::size> vec::operator &(const BRT_TYPE &) const'
1>        with
1>        [
1>            VALUE=char,
1>            tsize=4
1>        ]
1>        With the following template arguments:
1>        'vec'
1>        with
1>        [
1>            VALUE=int,
1>            tsize=4
1>        ]
1>c:/Users/drstrip/Documents/Visual Studio 2008/Projects/PotsModel/pots.br(8) : error C2676: binary '&' : 'vec' does not define this operator or a conversion to a type acceptable to the predefined operator
1>        with
1>        [
1>            VALUE=char,
1>            tsize=4
1>        ]

 

Any help would be welcome.

0 Likes
1 Reply
drstrip
Journeyman III

apparently VS2008 needs yet one more cast -

kernel uint4 compareToNeighbor(uint4 new_spin<>, uint4 neighbor<>
{
  return (uint4)((int4)((int4) new_spin != (int4) neighbor) & int4(1,1,1,1));
}

0 Likes