1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 #include "testing/gtest/include/gtest/gtest.h"
12 MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(MoveOnly
)
17 MoveOnly(MoveOnly
&& other
) {}
18 MoveOnly
& operator=(MoveOnly
&& other
) { return *this; }
23 Container() = default;
24 Container(const Container
& other
) = default;
25 Container
& operator=(const Container
& other
) = default;
27 Container(Container
&& other
) { value_
= other
.value_
.Pass(); }
29 Container
& operator=(Container
&& other
) {
30 value_
= other
.value_
.Pass();
38 Container
GetContainerRvalue() {
43 TEST(MoveTest
, CopyableContainerCanBeMoved
) {
44 // Container should be move-constructible and move-assignable.
45 Container y
= GetContainerRvalue();
46 y
= GetContainerRvalue();