Skip to content

Instantly share code, notes, and snippets.

@djg
Created July 10, 2010 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djg/470505 to your computer and use it in GitHub Desktop.
Save djg/470505 to your computer and use it in GitHub Desktop.
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