Hi there,
I am porting code from windows using visual studio to mac with xcode.
Quite a lot of issue have a appeared, which is no surprise, one warning that keeps on appearing is Explicit Specialiszation cannot have a storage class:
I could do a #define __GNUC__ but i was checking if anyone has came across this problem.
thanks
I am porting code from windows using visual studio to mac with xcode.
Quite a lot of issue have a appeared, which is no surprise, one warning that keeps on appearing is Explicit Specialiszation cannot have a storage class:
Code:
enum SortReturnCodeEnum {LOWEST=1, HIGHEST=2, HIGHLOW = 3, IDENTICAL=4};
template<typename tKey>
static SortReturnCodeEnum DefaultCompare(typename ArgType<tKey>::ARGT Value1, typename ArgType<tKey>::ARGT Value2)
{
if(Value1 < Value2)
{
return LOWEST;
}
else if(Value1 > Value2)
{
return HIGHEST;
}
return IDENTICAL;
}
//here it complains about the warning and suggest removing //the 'static' which will fail on visual studio
template<>
static SortReturnCodeEnum DefaultCompare<const char*>(typename ArgType<const char*>::ARGT Value1, typename ArgType<const char*>::ARGT Value2)
{
const char *pOne = Value1;
const char *pTwo = Value2;
while(*pOne && *pTwo)
{
if(*pOne < *pTwo)
{
return LOWEST;
}
else if(*pOne > *pTwo)
{
return HIGHEST;
}
++pOne;
++pTwo;
}
if(!(*pOne) && *pTwo)
{
return HIGHEST;
}
else if(*pOne && !(*pTwo))
{
return LOWEST;
}
return IDENTICAL;
}
thanks
Comment