It's not often that I work in C++ and I've run into a simple error that is holding me up.
In Xcode I have the following two errors:
In Event.h: Control reaches end of non-void function
In Event.cpp: Overloaded operator must have at least one argument of class or enumeration
Both errors are at the lines of the method signature for
bool operator () (Event *left, Event *right)
Here are the .h and .cpp files in their entirety (not that much going on yet): Event.h
#ifndef __EventSimulation__EventComparison__
#define __EventSimulation__EventComparison__
#include <iostream>
#include "Event.h"
class EventComparison {
public:
bool operator () (Event *left, Event *right){}
};
#endif
Event.cpp
#include "EventComparison.h"
#include "Event.h"
bool operator() (Event *left, Event *right) {
return left->time > right->time;
}
Can someone please help me fix this error and explain what/why things are issuing a compile error and how to avoid this in the feature. Thanks for your help!