aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader/NodeTools.cpp
diff options
context:
space:
mode:
author George L. Albany <Megacake1234@gmail.com>2023-10-17 13:38:16 +0200
committer GitHub <noreply@github.com>2023-10-17 13:38:16 +0200
commitd4f3231d53da69d98312523fbd9ffee31f3aeaf1 (patch)
treeefe00bd1761b4e430fc0efcbfb6cd01df41b4e39 /src/openvic-simulation/dataloader/NodeTools.cpp
parentf85a0880e19c0ca75eea80f8f38c1e061269dd08 (diff)
parente9a25973d209702e05e30bee4e8f96376ce800a9 (diff)
Merge pull request #56 from OpenVicProject/some-node-tool-concepts
Diffstat (limited to 'src/openvic-simulation/dataloader/NodeTools.cpp')
-rw-r--r--src/openvic-simulation/dataloader/NodeTools.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/openvic-simulation/dataloader/NodeTools.cpp b/src/openvic-simulation/dataloader/NodeTools.cpp
index 77eafcd..85bc572 100644
--- a/src/openvic-simulation/dataloader/NodeTools.cpp
+++ b/src/openvic-simulation/dataloader/NodeTools.cpp
@@ -4,7 +4,7 @@ using namespace OpenVic;
using namespace OpenVic::NodeTools;
template<typename T>
-static node_callback_t _expect_type(callback_t<T const&> callback) {
+static NodeCallback auto _expect_type(Callback<T const&> auto callback) {
return [callback](ast::NodeCPtr node) -> bool {
if (node != nullptr) {
T const* cast_node = node->cast_to<T>();
@@ -20,7 +20,7 @@ static node_callback_t _expect_type(callback_t<T const&> callback) {
}
template<std::derived_from<ast::AbstractStringNode> T>
-static callback_t<T const&> _abstract_string_node_callback(callback_t<std::string_view> callback, bool allow_empty) {
+static Callback<T const&> auto _abstract_string_node_callback(Callback<std::string_view> auto callback, bool allow_empty) {
return [callback, allow_empty](T const& node) -> bool {
if (allow_empty) {
return callback(node._name);
@@ -175,7 +175,7 @@ node_callback_t NodeTools::expect_days(callback_t<Timespan> callback) {
}
template<typename T, node_callback_t (*expect_func)(callback_t<T>)>
-node_callback_t _expect_vec2(callback_t<vec2_t<T>> callback) {
+NodeCallback auto _expect_vec2(Callback<vec2_t<T>> auto callback) {
return [callback](ast::NodeCPtr node) -> bool {
vec2_t<T> vec;
bool ret = expect_dictionary_keys(