From 5e9ffc26c26cbcb85a9e18f719fde1b9c178477f Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 6 Aug 2023 20:10:14 +0200 Subject: A6: WIP (text is more or less in place) --- a3/Makefile | 2 +- a3/concurrency.cc | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'a3') 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 #include #include +#include class Measure { @@ -89,7 +90,8 @@ template std::vector find_all(const C& c, const T& key) { std::vector 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) -- cgit v1.2.3