Czesc pisze sobie funkcja ktora ma za zadanie skonkatenowac wiele rzeczy ze soba.
Przejde do sedna chcialbym zeby w main'ie sobie taka funkcje wywolac z rozna iloscia parametrow czyli to co wrzucam przy wywolaniu funkcji ma zostac skonkatenowane z tym co mam w funkcji a nastepnie ten napis ma zostac wyslany innej funkcji.
Ale mam problem przy kompilacji kod wrzucam ponizej i dodam ze mam ustawiony w IDE kompilator C++14
#include "TabelaSQL.hpp"
using namespace std;
using namespace pqxx;
template <typename First, typename... Rest> void TabelaPostgre::create(const First& first, const Rest&... rest)
{
create(rest...);
string sql="CREATE TABLE "+create(rest...);
work W(C);
W.exec(sql);
W.commit();
}
TabelaPostgre::~TabelaPostgre()
{
cout<<"Dzialam"<<endl;
C.disconnect();
}
int main()
{
cout<<"hehe"<<endl;
TabelaPostgre *Obiekt=new TabelaPostgre("marcel","postgres","haslo","127.0.0.1","5432");
TabelaPostgre::create("first");
delete Obiekt;
return 0;
}
TabelaPostgre.cpp|45|error: cannot call member function ‘void TabelaPostgre::create(const First&, const Rest& ...) [with First = char [6]; Rest = {}]’ without object|
Prosilbym o wytlumaczenie dodam ze parameter pack'ow ucze sie stad : https://msdn.microsoft.com/pl-pl/library/dn439779.aspx
Pozdrawiam