19#ifndef LIBSEMIGROUPS_DETAIL_GUARD_HPP_
20#define LIBSEMIGROUPS_DETAIL_GUARD_HPP_
22#include "libsemigroups/is_specialization_of.hpp"
30 template <
typename Thing>
37 Guard(Guard
const&) =
delete;
38 Guard(Guard&&) =
delete;
39 Guard& operator=(Guard
const&) =
delete;
40 Guard& operator=(Guard&&) =
delete;
42 Guard(Thing& value, Thing new_value) : _old_value(value), _value(value) {
46 template <
typename Value>
47 Guard(Thing& value, Value new_value)
48 : _old_value(value.load()), _value(value) {
52 explicit Guard(Thing& value) : _old_value(value), _value(value) {}
56 _value = _old_value.load();
63 template <
typename Thing>
64 Guard(Thing& value,
typename Thing::value_type new_value) -> Guard<Thing>;
constexpr bool is_specialization_of_v
Helper variable template for is_specialization_of.
Definition is_specialization_of.hpp:83
Namespace for everything in the libsemigroups library.
Definition action.hpp:44