Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Commit 6e1bd0ca authored by Guangting Yu's avatar Guangting Yu
Browse files

give up ranges to compile with g++ 9.3.0

parent 0410af27
#include <iostream>
#include <cassert>
#include <numeric>
#include <ranges>
#include <vector>
#include <cmath>
......@@ -28,8 +27,11 @@ class EulerSum{
size_t range;
void thread_parent(){
// serial implementation
auto r=ranges::iota_view(range, 2*range);
for_each(r.begin(), r.end(), thread_child);
vector<size_t> r(range, range);
for(auto it=r.begin(); it!=r.end(); it++){
(*it)+=it-r.begin();
}
for(auto& n:r) thread_child(n);
}
void thread_child(size_t sum){
......@@ -75,7 +77,7 @@ class EulerSum{
}
public:
EulerSum(auto l, auto p, auto r):
EulerSum(size_t l, size_t p, size_t r):
length(l), power(p), range(r) {
if(range<length){
cerr << endl;
......@@ -93,4 +95,4 @@ int main(int argc, char* argv[]){
static_cast<size_t>(atoi(argv[3]))
);
return EXIT_SUCCESS;
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment