24 Aug
2005
24 Aug
'05
11:18 p.m.
virtual void setup() { m_space = new char[sizeof(F)]; new (m_space) F; } virtual void teardown() { ((F*)m_space)->~F(); delete m_space; } char* m_space;
In that case, why use m_space at all. Instead, just something like the following (which may have stupid syntax errors):
template<typename F> class global_fixture_impl : public global_fixture { virtual void setup() { m_f = new F; }; virtual void teardown() { delete m_f; m_f = 0; }; F* m_f; }
Yes, you right of course ;)) Gennadiy