I have something like this:
Including the header for class A, just to type "Master<A>::STATIC_MEMBER" seems messy, and saying "Master<any type, because the static member doesn't depend on it>::STATIC_MEBER" seems wrong.
Is there a way around this... most preferably pre C++11. Thanks in advance.
I don't think so. I guess you could do Master<void>::STATIC_MEMBER or something. The meaning is clear and there are no practical implications. Arguably, if you need to use that constant in places that don't need the rest of the class, it shouldn't be a part of it at all. The compiler will copy your entire template class into helper.hpp just for that single constant and that's not exactly optimal.
[EDIT]
Actually, don't do the void thing. It doesn't work.
Could you try having a class on top of it?
class MasterParent { public: static const ALLEGRO_EVENT_TYPE STATIC_MEMBER; } template<typename T> class Master<T> : public MasterParent { //rest of your class that does use the template }
(this is just a guess...)
Hahahahaha
Actually class A and B were the same one, only in my head were they separated things.(Because in this case the class actually does two things). That solves it
Also, I've found this method that gave no errors[1]
J-Gamer, I have considered that option, but I would consider that more of a work-around. Luckily I've found this.
Stas, and J-Gamer thanks for trying. Here's some of my fails, for laughs:
//(1 template Master::STATIC_MEMBER; //(2 Master<...>::STATIC_MEMBER;