1
0

Simplify Path::walk templates.

This commit is contained in:
David Allemang
2021-10-31 14:27:44 -04:00
parent 3194181e1b
commit ec4c1d213c
2 changed files with 17 additions and 53 deletions

View File

@@ -7,14 +7,12 @@ int main() {
auto cube = tc::group::B(3);
auto vars = cube.solve();
auto words = vars.path.walk<std::string, std::string>(
"",
{"a", "b", "c"},
[](auto a, auto b) { return a + b; }
);
std::string start;
std::vector<std::string> names = {"a", "b", "c"};
auto words = vars.path.walk(start, names, std::plus<>());
for (const auto &word : words) {
std::cout << word << std::endl;
for (const auto &word: words) {
std::cout << (word.empty() ? "-" : word) << std::endl;
}
return 0;