diff --git a/include/data.hpp b/include/data.hpp index e6d4d4f..40faf74 100644 --- a/include/data.hpp +++ b/include/data.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include "cpp_utils/assert.hpp" @@ -333,7 +334,7 @@ struct data_handler { const char* module; const char* path; - volatile bool changed = false; + std::atomic changed = false; mutable server_lock lock; std::vector data_; }; diff --git a/include/money.hpp b/include/money.hpp index be7890a..ba02875 100644 --- a/include/money.hpp +++ b/include/money.hpp @@ -36,7 +36,7 @@ struct money { } static money from_double(double dollars) { - const long dollars_long = static_cast(dollars); + const auto dollars_long = static_cast(dollars); return {dollars_long, static_cast((dollars - dollars_long) * SCALE)}; } diff --git a/include/views.hpp b/include/views.hpp index 2e1d9c7..84407a8 100644 --- a/include/views.hpp +++ b/include/views.hpp @@ -384,7 +384,6 @@ bool range_contains(const R& r, const std::ranges::range_value_t & value) { #endif } - // TODO(C+23) In the future, we can simply ranges::to but it is not yet implemented with GCC template @@ -406,7 +405,7 @@ auto to_vector(R&& r) { template auto min_with_default(R&& r, std::ranges::range_value_t def) { if (r) { - return std::ranges::min(r); + return std::ranges::min(std::forward(r)); } return def;