[flang][OpenMP] Change clause modifier representation in parser (#116656)
[llvm-project.git] / libcxx / test / support / double_move_tracker.h
blobfac575d9df08fbafec9ac579f35fb50125a4a134
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef TEST_SUPPORT_DOUBLE_MOVE_TRACKER_H
10 #define TEST_SUPPORT_DOUBLE_MOVE_TRACKER_H
12 #include <cassert>
14 #include "test_macros.h"
16 namespace support {
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;
33 moved_from_ = false;
34 return *this;
37 private:
38 bool moved_from_;
41 } // namespace support
43 #endif // TEST_SUPPORT_DOUBLE_MOVE_TRACKER_H