utils: a helper for lambda overloading

Change-Id: Ie9264a413817b83e310706eaaa3c6ed83ab6467d
Link: https://tamir.dev/posts/that-overloaded-trick-overloading-lambdas-in-cpp17/
diff --git a/src/utils.hpp b/src/utils.hpp
index ec3f3c8..f2f5136 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -29,3 +29,6 @@
 std::string stripLastListInstanceFromPath(const std::string& path);
 // The second argument controls whether module prefixes should be added to the keys.
 std::string instanceToString(const ListInstance& instance, const std::optional<std::string>& modName = std::nullopt);
+
+template <typename... Ts> struct overloaded : Ts... { using Ts::operator()...; };
+template <typename... Ts> overloaded(Ts...) -> overloaded<Ts...>;