mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-16 08:12:12 +11:00
17 lines
No EOL
346 B
C++
17 lines
No EOL
346 B
C++
#pragma once
|
|
#include <atomic>
|
|
|
|
template <bool init>
|
|
class ChangeFlag
|
|
{
|
|
private:
|
|
std::atomic<bool> change_flag = init; //if true changes have been made
|
|
|
|
public:
|
|
ChangeFlag() noexcept;
|
|
ChangeFlag(ChangeFlag &&) noexcept;
|
|
|
|
void SetChangesOn() noexcept;
|
|
void SetChangesOff() noexcept;
|
|
bool GetChangeState() const noexcept;
|
|
}; |