
22 Oct
2010
22 Oct
'10
9:01 p.m.
On 22 October 2010 14:09, Daniel Walker <daniel.j.walker@gmail.com> wrote:
To make the example portable, you need to add a destructor to S1.
Why?
struct S1 { ~S1() {} void operator()() {} void* operator new(std::size_t, void* p) { // throw on third alloc if(++i == 3) throw std::bad_alloc(); return p = ::new S1(); } }; -- Nevin ":-)" Liber <mailto:nevin@eviloverlord.com> (847) 691-1404