Isn't it possible to have a reference to an Objective C protocol inside a C++ class? The
(id)<B2ContactListener> _B2ContactListener;
line results in two errors:
'Expected ; at end of declaration list'
and
'C++ requires a type specifier for all declarations'.
Here's the code.
B2_ContactListener.mm:
#import "Box2D.h"
#import "B2_ContactListener.h"
class ContactListener : public b2ContactListener
{
private:
(id)<B2ContactListener> _B2ContactListener; // ERRORs
public:
//Methods
};
B2_ContactListener.h:
#import "B2_Contact.h"
@protocol B2ContactListener
-(void)B2BeginContact: (B2Contact*) contact;
@end
I'm using the current XCode compiler BTW.