Created
July 10, 2010 06:41
-
-
Save djg/470505 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class CODE> | |
class A | |
{ | |
protected: | |
CODE code; | |
// This is wrong, it needs to me template <class EVENT, class CODE> friend EVENT& createEvent(...) | |
template <class EVENT> | |
friend EVENT& createEvent(CODE code, bool down, bool repeat); | |
}; | |
// some where else | |
template <class EVENT, class CODE> | |
EVENT& createEvent(CODE code, bool down, bool repeat) | |
{ | |
static EVENT event; | |
event.code = code; | |
return event; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment