aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/actors/util/ut_helpers.h
blob: d3fe873233e5388913c2af5acf95b13afe9435ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#pragma once

// calls TCallback for all args permutations including (id, id)
template <class TCallback, class... TArgs>
void Permutate(TCallback&& fn, TArgs&&... args)
{
    auto forAll = [&](auto& arg){
        (fn(std::forward<decltype(arg)>(arg), std::forward<decltype(args)>(args)), ...);
    };

    (forAll(std::forward<decltype(args)>(args)), ...);
}