diff --git a/components/misc/tuplehelpers.hpp b/components/misc/tuplehelpers.hpp new file mode 100644 index 0000000000..09e61c1539 --- /dev/null +++ b/components/misc/tuplehelpers.hpp @@ -0,0 +1,15 @@ +#ifndef OPENMW_COMPONENTS_MISC_TUPLEHELPER_H +#define OPENMW_COMPONENTS_MISC_TUPLEHELPER_H + +#include + +namespace Misc +{ + template + void tupleForEach(TupleType& tuple, Callable&& f) + { + std::apply([&f](auto&... x) { (f(x), ...); }, tuple); + } +} + +#endif