File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -317,17 +317,15 @@ TEST(UniqueFunctionTest, MovedFromStateIsDestroyedCorrectly) {
317
317
static int NumOfDestructorsCalled = 0 ;
318
318
struct State {
319
319
State () = default ;
320
- State (const State &) = delete ;
321
320
State (State &&) { ++NumOfMovesCalled; }
322
- State &operator =(const State &) = delete ;
323
- State &operator =(State &&Rhs) { return *new (this ) State{std::move (Rhs)}; }
324
321
~State () { ++NumOfDestructorsCalled; }
325
322
};
326
323
{
327
324
unique_function<void ()> CapturingFunction{[state = State{}] {}};
328
325
unique_function<void ()> CapturingFunctionMoved{
329
326
std::move (CapturingFunction)};
330
327
}
328
+ printf (" %i, %i\n " , NumOfMovesCalled, NumOfDestructorsCalled);
331
329
EXPECT_EQ (NumOfDestructorsCalled, 1 + NumOfMovesCalled);
332
330
}
333
331
You can’t perform that action at this time.
0 commit comments