I've a little problem in my code. I try to create a function with variadic parameter, but when I compile it, it fail, and i really don't see why. So if anyone could help me ...
here is my function:
QuerySet.hpp:
template <typename T>
class QuerySet
{
template<typename U,typename ... Args>
QuerySet& filter(const std::string& colum,Args ... args,const std::string& operation, const U& value);
//...
}
template<typename T>
template<typename U,typename ... Args>
QuerySet<T>& QuerySet<T>::filter(const std::string& colum,Args ... args,const std::string& operation, const U& value)
{
//some job
return *this;
}
main.cpp QuerySet queryset; queryset.filter(Perso::_master,Perso::_lvl,"gt",4); //line 135
Note: Perso::_master and Perso::_lvl are some static const std::string;
Error:
g++ -g -std=c++0x -I"/my_path/cpp-ORM" -lmysqlcppconn -o main.o -c main.cpp;
main.cpp: In function ‘int main(int, char**)’:
main.cpp:135:46: erreur: no matching function for call to ‘orm::QuerySet<Perso>::filter(const string&, const string&, const string&, int)’
main.cpp:135:46: note: candidate is:
/my_path/QuerySet.hpp:18:23: note: template<class U, class ... Args> orm::QuerySet<T>& orm::QuerySet::filter(const string&, Args ..., const string&, const U&) [with U = U, Args = {Args ...}, T = Perso, std::string = std::basic_string<char>]
Informations : I use gcc version 4.6.4 (Ubuntu/Linaro 4.6.4-1ubuntu1~12.04), but I try with gcc4.8, and I've a error to.