M
Marcel Müller
I have a code snippet that crates a warning with gcc (older version):
template <class Element,
class Key,
int(*Comparer)(const Key& key, const Element& elem)>
class sorted_vector_own
{ // ...
};
class File
{ // ...
};
struct Parameters
{private:
static int CompareMeasurement(const char*const& key, const File& data);
public:
typedef sorted_vector_own<File,
const char*,
&Parameters::CompareMeasurement>
MeasurementSet;
MeasurementSet Measurements;
double FreqLow, FreqHigh;
// ...
};
test3.cpp:11: warning: all member functions in class `Parameters' are
private
OK, a compiler could warn about everything it likes. But what could be
the idea of this warning? What is wrong with a class with only private
functions?
Marcel
template <class Element,
class Key,
int(*Comparer)(const Key& key, const Element& elem)>
class sorted_vector_own
{ // ...
};
class File
{ // ...
};
struct Parameters
{private:
static int CompareMeasurement(const char*const& key, const File& data);
public:
typedef sorted_vector_own<File,
const char*,
&Parameters::CompareMeasurement>
MeasurementSet;
MeasurementSet Measurements;
double FreqLow, FreqHigh;
// ...
};
test3.cpp:11: warning: all member functions in class `Parameters' are
private
OK, a compiler could warn about everything it likes. But what could be
the idea of this warning? What is wrong with a class with only private
functions?
Marcel