#include <typeinfo>
template <typename T>
bool a2x( T& _f , char* p)
{
if( !p )
return false ; char* q = p ;
while( q != '\0')
{
if( *q == '-' && *(q+) >= '' && *(q+)<= '' )
{
break ;
} if( *q >= '' && *q <= '' )
break ; q++ ;
}
if( q =='\0')
return false ; if(typeid(float).name() == typeid(_f).name() )
sscanf(q,"%f",&_f );
else if(typeid(int).name() == typeid(_f).name() )
sscanf(q,"%d",&_f );
else if(typeid(long).name() == typeid(_f).name() )
sscanf(q,"%ld",&_f );
else if(typeid(double).name() == typeid(_f).name() )
sscanf(q,"%lf",&_f );
else
return false ; return true ;
}