openmw/components/misc/tuplehelpers.hpp

16 lines
317 B
C++
Raw Normal View History

2022-09-10 20:25:18 +02:00
#ifndef OPENMW_COMPONENTS_MISC_TUPLEHELPER_H
#define OPENMW_COMPONENTS_MISC_TUPLEHELPER_H
#include <tuple>
namespace Misc
{
template <typename TupleType, typename Callable>
void tupleForEach(TupleType& tuple, Callable&& f)
{
std::apply([&f](auto&... x) { (f(x), ...); }, tuple);
}
}
#endif