Boost logo

Boost Users :

From: Kim Barrett (kab_at_[hidden])
Date: 2005-08-24 16:35:53


At 4:22 PM -0400 8/24/05, Gennadiy Rozental wrote:
>You maybe right. I will use new then,
>
>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;
}


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net