1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef TEST_SUPPORT_DOUBLE_MOVE_TRACKER_H
10 #define TEST_SUPPORT_DOUBLE_MOVE_TRACKER_H
14 #include "test_macros.h"
18 struct double_move_tracker
{
19 TEST_CONSTEXPR
double_move_tracker() : moved_from_(false) {}
21 double_move_tracker(double_move_tracker
const&) = default;
23 TEST_CONSTEXPR_CXX14
double_move_tracker(double_move_tracker
&& other
) : moved_from_(false) {
24 assert(!other
.moved_from_
);
25 other
.moved_from_
= true;
28 double_move_tracker
& operator=(double_move_tracker
const&) = default;
30 TEST_CONSTEXPR_CXX14 double_move_tracker
& operator=(double_move_tracker
&& other
) {
31 assert(!other
.moved_from_
);
32 other
.moved_from_
= true;
41 } // namespace support
43 #endif // TEST_SUPPORT_DOUBLE_MOVE_TRACKER_H