
1 Mar
2007
1 Mar
'07
1:32 a.m.
Giovanni Piero Deretta <gpderetta <at> gmail.com> writes:
template<class A> ordinal_tag const ordinal<A>::tag = ordinal_tag();
You need to actually define const static members of out of class.
That's what the above line does. It would work fine.
Comparing pointers outside of arrays is not portable, on the other hand std::less<T*> is required to do the RightThing.
That is good to know, thanks!
Anyways, while pointers to static function variables are guaranteed unique, they are not constant expressions, so this might not be what the OP was looking for.
Pointers to class static members can be passed as template non-type arguments, though, which might be sufficient. -Lewis