It's been an hour since I am doing some research for informations about partial template specialisation. Unfortunately this is not successful .. I still found a lot of information, but not to solve my problem. So I hope that someone can help me.
Consider the following minimal code:
SQLObject.hpp
template<typename T>
class SQLObject
{
public:
template<typename U>
static std::list<T*> filter(const std::string& colum,const std::string& ope,const U& value);
static std::list<T*> filter(const Filter& filter);
}
#include "SQLObject.tpl"
SQLObject.tpl
#include "Filter.hpp"
/* This code do not work, but why ??? */
template<typename T>
template<>
std::list<T*> SQLObject<T>::filter<std::string>(const std::string& colum,const std::string& ope,const std::string& value)
{
// no to_string need whith std::string
return filter(Filter(colum,ope,value));
}
template<typename T>
template<typename U>
std::list<T*> SQLObject<T>::filter(const std::string& colum,const std::string& ope,const U& value)
{
//use to_string with all others types
return filter(Filter(colum,ope,std::to_string(value)));
}
template<typename T>
std::list<T*> SQLObject<T>::filter(const Filter& filter)
{
//some stuff
}
My problem is the following: I am not able to specialize filter with std :: string.
So I tried a simple overload, but without success. So I turn to you, hoping that you could help me.