M
ma740988
I'm following section 35 of the FAQ and am I'm trying to do some
specialization. Trouble is I have a recursive problem here that I'm
not sure how to solve. Ideas?
The snippet:
# include <iostream>
template <typename T>
void foo_test ( T const* ptr ){}
template<> inline void foo_test<float> ( const float* ptr )
{ std::cout << " float " << std::endl; foo_test ( ptr ); }
template<> inline void foo_test<double> ( const double* ptr )
{ std::cout << " double " << std::endl; foo_test ( ptr ); }
int main ( void )
{
double t ( 5 );
double *ptr_t = &t;
foo_test<double>(ptr_t);
}
Thanks in advance.
specialization. Trouble is I have a recursive problem here that I'm
not sure how to solve. Ideas?
The snippet:
# include <iostream>
template <typename T>
void foo_test ( T const* ptr ){}
template<> inline void foo_test<float> ( const float* ptr )
{ std::cout << " float " << std::endl; foo_test ( ptr ); }
template<> inline void foo_test<double> ( const double* ptr )
{ std::cout << " double " << std::endl; foo_test ( ptr ); }
int main ( void )
{
double t ( 5 );
double *ptr_t = &t;
foo_test<double>(ptr_t);
}
Thanks in advance.