nooky59
17th July 2008, 10:32
Hello,
I usually compile my code with the MSVC compiler but I tried yesterday to compile it on Mac OS X with GCC.
I have a function declared like that :
void myfunction(const QHash<QString, QVariant> &callback = QHash<QString, QVariant>());
It compiles well in MSVC but it seems GCC as some troubles with such a construct.
I have changed my code to take a pointer :
void myfunction(const QHash<QString, QVariant> *callback = 0);
But is there a way to keep a construct without pointer which accept such an optionnal parameter with a template class ?
I usually compile my code with the MSVC compiler but I tried yesterday to compile it on Mac OS X with GCC.
I have a function declared like that :
void myfunction(const QHash<QString, QVariant> &callback = QHash<QString, QVariant>());
It compiles well in MSVC but it seems GCC as some troubles with such a construct.
I have changed my code to take a pointer :
void myfunction(const QHash<QString, QVariant> *callback = 0);
But is there a way to keep a construct without pointer which accept such an optionnal parameter with a template class ?