Visual c++ VisualStudio中的OMPTL?

Visual c++ VisualStudio中的OMPTL?,visual-c++,stl,openmp,Visual C++,Stl,Openmp,我试图在VisualStudio中使用。据我所知,我只需要设置/openmp选项,以便OMPTL使用一些stl函数的多线程实现 当我不使用/openmp时,一切都很好,OMPTL将函数映射到它们的正常stl计数器部分,而不使用多线程。但是,使用/openmp时,我遇到一个编译器错误: Error 1 error C2572: 'omptl::transform_accumulate' : redefinition of default parameter : parameter 6 ..\inc

我试图在VisualStudio中使用。据我所知,我只需要设置/openmp选项,以便OMPTL使用一些stl函数的多线程实现

当我不使用/openmp时,一切都很好,OMPTL将函数映射到它们的正常stl计数器部分,而不使用多线程。但是,使用/openmp时,我遇到一个编译器错误:

Error 1 error C2572: 'omptl::transform_accumulate' : redefinition of default parameter : parameter 6 ..\include\omptl\omptl_numeric_extentions_par.h 132
这句话的意思是

template <class Iterator, class T, class UnaryFunction, class BinaryFunction>
T transform_accumulate(Iterator first, Iterator last, const T init,
   UnaryFunction unary_op, BinaryFunction binary_op,
   const unsigned P = omp_get_max_threads())
{
 return ::omptl::_TransformAccumulate
 <typename ::std::iterator_traits<Iterator>::iterator_category>
  ::transform_accumulate(first, last, init,
     unary_op, binary_op, P);
}

是否有办法解决此问题,或者OMPTL不能与Microsoft的编译器一起使用?

编译器似乎不接受此模板声明中的默认参数。从两个声明中删除=omp\u get\u max\u线程为我解决了问题。

是的,我正在考虑这样做,但是我不记得我是否真的尝试过,以及当时是否发生了任何其他问题。如果我再次着手那个项目,我会再试一次:。