summaryrefslogtreecommitdiff
path: root/a3
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2023-08-06 20:10:14 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2023-08-06 20:10:14 +0200
commit5e9ffc26c26cbcb85a9e18f719fde1b9c178477f (patch)
tree584ee5847a0705e6ed20ef11664d569518738d5b /a3
parent025622f7ba344b1e47dd47c92ed380902ecbddfd (diff)
A6: WIP (text is more or less in place)
Diffstat (limited to 'a3')
-rw-r--r--a3/Makefile2
-rw-r--r--a3/concurrency.cc4
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)