From 7301fe6484dc1b1d652425ad005ccfd214002a87 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 24 Aug 2025 12:00:10 +0100 Subject: Merge storeEntities into a single thing Add visitSum for tuples and makes storeEntities into a single lambda. --- src/util.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/util.hpp (limited to 'src/util.hpp') diff --git a/src/util.hpp b/src/util.hpp new file mode 100644 index 0000000..0ed260c --- /dev/null +++ b/src/util.hpp @@ -0,0 +1,16 @@ +#pragma once + +#include + +namespace WebStat { + template + auto + visitSum(auto && visitor, const std::tuple & values) + { + return std::apply( + [&](auto &&... value) { + return (visitor(value) + ...); + }, + values); + } +} -- cgit v1.2.3