S
Siegfried Heintze
I'm running on g++ v2.95 and 3.2.
Why is it that the print functions work fine without any extra template
parameters, but the SizeOfCod2 function requires that the bold code be
uncommented?
Thanks,
Siegfried
template<typename T>void print (const T& xx){ std::cout << xx <<
std::endl; }
template<>void print (const std::string& xx){ std::cout << "string = " <<
xx << std::endl; }
template<>void print (const R2::Cod_st& xx) { std::cout << "r2 cod = " <<
std::endl; }
template<>void print (const R3::Cod_st& xx) { std::cout << "r3 cod = " <<
std::endl; }
namespace CodAddress{
template<typename COD> unsigned int SizeOfCod2(COD* = 0){ return
sizeof(COD); }
template<> unsigned int SizeOfCod2/*<R2::Cod_st>*/(R2::Cod_st* ){
return R2::Cod_st:ARAM::BLOCKSIZE +
CodAddress::LUNCopyChapterAddress/*<R2::Cod_st>*/() +
CodAddress::LUNCopyChapterSize<R2::Cod_st>();
}
};
Why is it that the print functions work fine without any extra template
parameters, but the SizeOfCod2 function requires that the bold code be
uncommented?
Thanks,
Siegfried
template<typename T>void print (const T& xx){ std::cout << xx <<
std::endl; }
template<>void print (const std::string& xx){ std::cout << "string = " <<
xx << std::endl; }
template<>void print (const R2::Cod_st& xx) { std::cout << "r2 cod = " <<
std::endl; }
template<>void print (const R3::Cod_st& xx) { std::cout << "r3 cod = " <<
std::endl; }
namespace CodAddress{
template<typename COD> unsigned int SizeOfCod2(COD* = 0){ return
sizeof(COD); }
template<> unsigned int SizeOfCod2/*<R2::Cod_st>*/(R2::Cod_st* ){
return R2::Cod_st:ARAM::BLOCKSIZE +
CodAddress::LUNCopyChapterAddress/*<R2::Cod_st>*/() +
CodAddress::LUNCopyChapterSize<R2::Cod_st>();
}
};