I am getting the following error when I try to access bins private member of the GHistogram
class from within the extractHistogram()
implementation:
error: 'QVector<double> MyNamespace::GHistogram::bins' is private
error: within this context
Where the 'within this context' error points to the extractHistogram()
implementation. Does anyone knows what's wrong with my friend function declaration?
Here's the code:
namespace MyNamespace{
class GHistogram
{
public:
GHistogram(qint32 numberOfBins);
qint32 getNumberOfBins();
/**
* Returns the frequency of the value i.
*/
double getValueAt(qint32 i);
friend GHistogram * MyNamespace::extractHistogram(GImage *image,
qint32 numberOfBins);
private:
QVector<double> bins;
};
GHistogram * extractHistogram(GImage * image,
qint32 numberOfBins);
} // End of MyNamespace