
Hello all, I just wanted to get some opinions on the following static allocation policy, revamped to ensure that there won't be alignment problems. Does anything need to be revised? template < typename Type > class AllocateStatically { public: typedef Type * Pointer; static Pointer Create ( ) { static Type instance; static bool first = true; if ( first ) { first = false; } else { new ( reinterpret_cast < Pointer > ( &instance ) ) Type; } return &instance; } static void Destroy ( Pointer p ) { p->~Type ( ); } }; -Jason