MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / generateCombinations

Function generateCombinations

tests/configs.cc:52–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52static std::vector<std::vector<std::string>> generateCombinations(
53 const std::vector<std::vector<std::string>>& groups)
54{
55
56 std::vector<std::vector<std::string>> result;
57 std::vector<std::string> current(groups.size());
58
59 std::function<void(int)> recurse = [&](int index)
60 {
61 if (index == groups.size())
62 result.push_back(current);
63 else
64 {
65 auto& group = groups.at(index);
66 for (auto& g : group)
67 {
68 current[index] = g;
69 recurse(index + 1);
70 }
71 }
72 };
73
74 if (!groups.empty())
75 recurse(0);
76
77 return result;
78}
79
80static void validateConfigWithOptions(std::string baseConfigName,
81 const std::vector<std::string>& options,

Callers 1

validateToplevelConfigFunction · 0.85

Calls 3

sizeMethod · 0.45
push_backMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected