auto allocator = TestAllocator(); Struct.numStructs.should == 0; { auto ptr = RefCounted!(Struct, TestAllocator*)(&allocator, 5); Struct.numStructs.shouldEqual(1); } Struct.numStructs.shouldEqual(0);
See Implementation