CTRE Phoenix 6 C++ 24.3.0
MovableMutex.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) Cross The Road Electronics.  All rights reserved.
3 * License information can be found in CTRE_LICENSE.txt
4 * For support and suggestions contact support@ctr-electronics.com or file
5 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
6 */
7#pragma once
8
9#include <mutex>
10
11namespace ctre {
12namespace phoenix {
13namespace threading {
14
15 /**
16 * \brief An extension of mutex that defines an empty move
17 * constructor and assignment operator.
18 *
19 * \details This allows classes using a #MovableMutex to have move semantics.
20 */
21 template <class MutexType>
22 class MovableMutex : public MutexType {
23 public:
24 MovableMutex() = default;
25 /* allow move semantics */
27 MovableMutex &operator=(MovableMutex &&) { return *this; }
28 };
29
30}
31}
32}
An extension of mutex that defines an empty move constructor and assignment operator.
Definition: MovableMutex.hpp:22
MovableMutex & operator=(MovableMutex &&)
Definition: MovableMutex.hpp:27
MovableMutex(MovableMutex &&)
Definition: MovableMutex.hpp:26
Definition: string_util.hpp:15