template
static T sum(const std::array& a)
{
T result;
// type of
It's unspecified (for OpenMP 3.0 or later) or undefined (for OpenMP 2.5)
reduction
is one of data-sharing attribute clauses, and OpenMP Application Program Interface Version 2.5 says:
2.8.3 Data-Sharing Attribute Clauses
---- C/C++ ----
If a variable referenced in a data-sharing attribute clause has a type derived from a template, and there are no other references to that variable in the program, then any behavior related to that variable is undefined.
---- C/C++ ----
OpenMP Application Program Interface Version 3.0 says:
2.9.3 Data-Sharing Attribute Clauses
---- C/C++ ----
If a variable referenced in a data-sharing attribute clause has a type derived from a template, and there are no other references to that variable in the program, then any behavior related to that variable is unspecified.
---- C/C++ ----