Initial Course
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#include "move_semantics.hpp"
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(MoveSemantics, MoveTransfersOwnership) {
|
||||
cpp11::MovableBuffer source{{1, 2, 3}};
|
||||
const auto moved_size = cpp11::consume(std::move(source));
|
||||
EXPECT_EQ(moved_size, 3U);
|
||||
EXPECT_EQ(source.size(), 0U);
|
||||
}
|
||||
Reference in New Issue
Block a user