I have a problem on Solaris using the Sun Studio compiler. It seems related to libCstd.
Consider the following code :
#include <list>
static bool f(double fFreq1, double fFreq2) { return false; }
int main()
{
std::list< double > l;
l.unique(f);
}
The error message I get is :
"uniq.cpp", line 6: Error: Could not find a match for std::list<double>::unique(bool(double,double)) needed in main().
But when I use references instead of values, it compiles just fine :
#include <list>
static bool f(const double& fFreq1, const double& fFreq2) { return false; }
int main()
{
std::list< double > l;
l.unique(f);
}
Compilation is ok for both using g++. Does anyone know what is going on ? Thanks !