Skip to content

Commit

Permalink
Merge pull request #31 from steiltre/bugfix/build_all_examples
Browse files Browse the repository at this point in the history
Fixes example/map_set.cpp to compile and adds to CMake
  • Loading branch information
steiltre authored Oct 1, 2021
2 parents 6b1ff96 + 03baa06 commit ce63dac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ add_mpi_omp_example(bag_insert_rate)
add_mpi_omp_example(word_counter)
add_mpi_omp_example(lambda_optional_arguments)
add_mpi_omp_example(map_visit_optional_arguments)
add_mpi_omp_example(map_set)
7 changes: 3 additions & 4 deletions examples/map_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
int main(int argc, char** argv) {
ygm::comm world(&argc, &argv);

ygm::container::set<std::string> str_set(world);
ygm::container::set<std::string> str_set(world);
ygm::container::map<std::string, std::string> str_map(world);

if (world.rank() == 0) {
Expand All @@ -25,11 +25,10 @@ int main(int argc, char** argv) {
str_map.async_set("strawberry", "raspberry");
}

str_set.all_for_all(
[](auto k) { std::cout << "str_set: " << k << std::endl; });
str_set.for_all([](auto k) { std::cout << "str_set: " << k << std::endl; });

str_map.for_all([](auto kv) {
std::cout << "str_map: " << kv.first << " -> " << kv.second << std::endl;
});
return 0;
}
}

0 comments on commit ce63dac

Please sign in to comment.