I have the following simple strinToTypeImpl
function which converts any kind of string into the template type. The problem I am concerned about is the fact that the compiler tells me for the partial specialization for typename MyMatrix<T>::Vector3
:
template parameter T not used in partial specialization
Can't I use dependent names in the specialization?
namespace details
{
template<typename T>
struct stringToTypeImpl{
bool operator()(T& t, const std::string& s)
{
std::istringstream iss(s);
return !(iss >> t).fail();
}
};
template<typename T>
struct stringToTypeImpl< typename MyMatrix<T>::Vector3 >{
// Replacing typename MyMatrix<T>::Vector3 by
// Eigen::Matrix<T,3,1> WORKS but why?
bool operator()(typename MyMatrix<PREC>::Vector3 & t, const std::string& s)
{
stringToVector3<PREC>(t,s);
}
};
}