diff options
Diffstat (limited to 'a3')
-rw-r--r-- | a3/Makefile | 2 | ||||
-rw-r--r-- | a3/concurrency.cc | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/a3/Makefile b/a3/Makefile index 1de80ba..eb74514 100644 --- a/a3/Makefile +++ b/a3/Makefile @@ -1,4 +1,4 @@ all: concurrency concurrency: concurrency.cc Makefile - g++ -Wall -Werror -Wextra -Wconversion -std=c++20 -pthread $< -o $@ + g++ -O2 -Wall -Werror -Wextra -Wconversion -std=c++20 -pthread $< -o $@ diff --git a/a3/concurrency.cc b/a3/concurrency.cc index 9838212..96da641 100644 --- a/a3/concurrency.cc +++ b/a3/concurrency.cc @@ -10,6 +10,7 @@ #include <concepts> #include <future> #include <ranges> +#include <execution> class Measure { @@ -89,7 +90,8 @@ template<typename C, typename T> std::vector<const T*> find_all(const C& c, const T& key) { std::vector<const T*> res{}; - std::for_each(c.begin(), c.end(), + std::for_each(std::execution::seq, + c.begin(), c.end(), [&key, &res](const T& value) { if(value == key) |