File: check-std_execution.cpp

package info (click to toggle)
stellarium 24.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 911,396 kB
  • sloc: ansic: 317,377; cpp: 204,602; xml: 48,590; javascript: 26,348; python: 1,254; perl: 1,108; sh: 207; makefile: 190; pascal: 169
file content (13 lines) | stat: -rw-r--r-- 239 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <array>
#include <execution>
#include <numeric>


const std::array<double, 4>a = {{0., 1., 2., 3.}};

int main()
{
	double res = std::reduce(std::execution::par,
	             a.begin(), a.end(), 0.0, std::plus<>());
	return 0;
}