aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader/NodeTools.hpp
diff options
context:
space:
mode:
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;
});
}