diff options
author | hop311 <hop3114@gmail.com> | 2023-10-20 08:39:37 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2023-10-20 08:39:37 +0200 |
commit | ab696e8469b1417b69d6b3aa5d46a69d370613a0 (patch) | |
tree | cdfdb2d6b500b7709fa381a3fd19369f21a52006 /src/openvic-simulation/dataloader | |
parent | 1484dd3aa73489cc66572f1c431e08c610e201af (diff) |
Minor cleanup
Diffstat (limited to 'src/openvic-simulation/dataloader')
-rw-r--r-- | src/openvic-simulation/dataloader/Dataloader.cpp | 2 | ||||
-rw-r--r-- | src/openvic-simulation/dataloader/NodeTools.hpp | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/openvic-simulation/dataloader/Dataloader.cpp b/src/openvic-simulation/dataloader/Dataloader.cpp index 475cdd1..cfc944d 100644 --- a/src/openvic-simulation/dataloader/Dataloader.cpp +++ b/src/openvic-simulation/dataloader/Dataloader.cpp @@ -48,7 +48,7 @@ static constexpr bool path_equals(std::string_view lhs, std::string_view rhs) { template<typename T> concept is_filename = std::same_as<T, std::filesystem::path> || std::convertible_to<T, std::string_view>; -bool filename_equals(const is_filename auto& lhs, const is_filename auto& rhs) { +static bool filename_equals(const is_filename auto& lhs, const is_filename auto& rhs) { auto left = [&lhs] { if constexpr (std::same_as<std::decay_t<decltype(lhs)>, std::filesystem::path>) return lhs.filename().string(); diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp index f06a85f..692e2cb 100644 --- a/src/openvic-simulation/dataloader/NodeTools.hpp +++ b/src/openvic-simulation/dataloader/NodeTools.hpp @@ -4,6 +4,7 @@ #include <cstdint> #include <functional> #include <map> +#include <set> #include <type_traits> #include <openvic-dataloader/v2script/AbstractSyntaxTree.hpp> @@ -16,10 +17,13 @@ namespace OpenVic { namespace ast = ovdl::v2script::ast; /* Template for map from strings to Ts, in which string_views can be - * searched for without needing to be copied into a string, */ + * searched for without needing to be copied into a string */ template<typename T> using string_map_t = std::map<std::string, T, std::less<void>>; + /* String set type supporting heterogeneous key lookup */ + using string_set_t = std::set<std::string, std::less<void>>; + namespace NodeTools { template<typename Fn, typename Return = void, typename ...Args> |