This may be an easy one to spot:
-
This may be an easy one to spot:
#include <SmartPtr.hpp>
class AnObject;
typedef SmartPtr<AnObject> AnObjectPtr;class AnObject
{
public:AnObject : self_(this) {}
virtual ~AnObject() {}
double f() { return g(self_) + h(self_); }
virtual double g(AnObjectPtr o) = 0;
virtual double h(AnObjectPtr o) = 0;private:
AnObjectPtr self_;
};Real code, written by real programmer...
-- God creates; man programs.
-
This may be an easy one to spot:
#include <SmartPtr.hpp>
class AnObject;
typedef SmartPtr<AnObject> AnObjectPtr;class AnObject
{
public:AnObject : self_(this) {}
virtual ~AnObject() {}
double f() { return g(self_) + h(self_); }
virtual double g(AnObjectPtr o) = 0;
virtual double h(AnObjectPtr o) = 0;private:
AnObjectPtr self_;
};Real code, written by real programmer...
-- God creates; man programs.
What was that programmer thinking? :)
-- The Show That Watches Back