TableInFile(const std::string &aFileName, std::vector<std::string> &aColumnNames, std::vector<std::string> &aColumnTypes, std::vector<void *> &aVectors, std::vector<enum OpeningMode> &aModes);
std::vector<void *> &aVectors
|
|
int addColumn(const std::string &aColumnName, const std::string &aColumnType, void * &aVector, const std::string &aColumnNameToInsertBefore);
|
|
../src/test.cpp:1044:93: error: no matching function for call to ‘TableInFile::addColumn(std::string, std::string, void*, std::string)’ /home/alain/Documents/Poker/WorkSpace/MyUtils/src/MyFiles.h:40:6: note: candidate is: int TableInFile::addColumn(const std::string&, const std::string&, void*&, const std::string&) make: *** [src/test.o] Error 1 |
|
|
void*
. I recast it to the type of a vector, and it works. The point is that I don't know at compile time the type T of vector<T>.int addColumn(const std::string &aColumnName, const std::string &aColumnType, void * aVector, const std::string &aColumnNameToInsertBefore);
, it compiles, but I obtain a wrong result :$ cat .table.txt string1 uint2 int23 float3 string u_int32_t int float raw1 111 -1338695944 1.1 raw2 222 959854643 2.2 raw3 333 875837749 3.3 raw4 444 2110254 4.4 |
&string1 = 0x7fff5a050d30, &uint2 = 0x7fff5a050d10, &float3 = 0x7fff5a050cf0 &int23 = 0x7fff5a050c70 mVectors = 0x7fff5a050d30, 0x7fff5a050d10, 0x7fff5a050c70, 0x7fff5a050cf0, |
t.write();
instead of having this call in the TableInFile destructor, then it works.