Boost logo

Boost :

From: Lewis Hyatt (lhyatt_at_[hidden])
Date: 2007-02-28 20:32:09


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk