aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader/NodeTools.hpp
diff options
context:
space:
mode:
author Joel Machens <ajmach6@gmail.com>2023-10-17 04:43:40 +0200
committer Joel Machens <ajmach6@gmail.com>2023-10-25 02:17:45 +0200
commitc9c198e3b47e84eaea998cd9d2f7a8aa2b50ce73 (patch)
treebd5fba638a55c683e587eb5e2bbde43ab5fb1a00 /src/openvic-simulation/dataloader/NodeTools.hpp
parent7bda541557722b2a244e80796c612b735d8b5cf7 (diff)
Country History & Order of Battle Loading
Diffstat (limited to 'src/openvic-simulation/dataloader/NodeTools.hpp')
-rw-r--r--src/openvic-simulation/dataloader/NodeTools.hpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp
index 66b614a..6469100 100644
--- a/src/openvic-simulation/dataloader/NodeTools.hpp
+++ b/src/openvic-simulation/dataloader/NodeTools.hpp
@@ -26,17 +26,17 @@ namespace OpenVic {
namespace NodeTools {
- template<typename Fn, typename Return = void, typename ...Args>
- concept Functor = requires(Fn&& fn, Args&& ...args) {
+ template<typename Fn, typename Return = void, typename... Args>
+ concept Functor = requires(Fn&& fn, Args&&... args) {
{ std::invoke(std::forward<Fn>(fn), std::forward<Args>(args)...) } -> std::same_as<Return>;
};
- template<typename Fn, typename Return = void, typename ...Args>
- concept FunctorConvertible = requires(Fn&& fn, Args&& ...args) {
+ template<typename Fn, typename Return = void, typename... Args>
+ concept FunctorConvertible = requires(Fn&& fn, Args&&... args) {
{ std::invoke(std::forward<Fn>(fn), std::forward<Args>(args)...) } -> std::convertible_to<Return>;
};
- template<typename Fn, typename ...Args>
+ template<typename Fn, typename... Args>
concept Callback = Functor<Fn, bool, Args...>;
template<typename Fn>
@@ -78,9 +78,7 @@ namespace OpenVic {
val <= static_cast<int64_t>(std::numeric_limits<T>::max())) {
return callback(val);
}
- Logger::error("Invalid int: ", val, " (valid range: [",
- static_cast<int64_t>(std::numeric_limits<T>::lowest()), ", ",
- static_cast<int64_t>(std::numeric_limits<T>::max()), "])");
+ Logger::error("Invalid int: ", val, " (valid range: [", static_cast<int64_t>(std::numeric_limits<T>::lowest()), ", ", static_cast<int64_t>(std::numeric_limits<T>::max()), "])");
return false;
});
}
@@ -91,8 +89,7 @@ namespace OpenVic {
if (val <= static_cast<uint64_t>(std::numeric_limits<T>::max())) {
return callback(val);
}
- Logger::error("Invalid uint: ", val, " (valid range: [0, ",
- static_cast<uint64_t>(std::numeric_limits<T>::max()), "])");
+ Logger::error("Invalid uint: ", val, " (valid range: [0, ", static_cast<uint64_t>(std::numeric_limits<T>::max()), "])");
return false;
});
}