Re: self-referencing policies
Hang on, that doesn't do what the original post was trying to achieve. In the OP, you had policy defining a type declared within the template argument
Code:
template<class T>
struct policy
{
typedef typename T::fooType fooType;
};
The one you've just posted is functionally equivalent to
Code:
template<class T>
struct policy
{
typedef T DerivedType;
};
(or has the cold addled my brain, and I'm missing something obvious?)
ETA: I see someone else has had the same thought - maybe it's not just me, then.
Correct is better than fast. Simple is better than complex. Clear is better than cute. Safe is better than insecure.
-- Sutter and Alexandrescu, C++ Coding Standards
Programs must be written for people to read, and only incidentally for machines to execute.
-- Harold Abelson and Gerald Jay Sussman
The cheapest, fastest and most reliable components of a computer system are those that aren't there.
-- Gordon Bell