diff --git a/test/triqs/arrays/array_mpi.cpp b/test/triqs/arrays/array_mpi.cpp index 40f7545c..34276568 100644 --- a/test/triqs/arrays/array_mpi.cpp +++ b/test/triqs/arrays/array_mpi.cpp @@ -24,6 +24,7 @@ #include #include #include +#include using std::cout; using std::endl; using namespace triqs::arrays; @@ -43,7 +44,7 @@ int main(int argc, char* argv[]) if (world.rank() ==0) std::cout<<" A = "< >(),0); + boost::mpi::reduce (world, A,C, std::c14::plus<>(),0); int s= world.size(); if (world.rank() ==0) std::cout<<" C = "<( (s*(s+1)/2) * A) <. + * + ******************************************************************************/ +#ifndef TRIQS_C14_FIX_H +#define TRIQS_C14_FIX_H +#include +#include + +// a few that will be C++14, use in advance.... + +namespace std { + namespace c14 { + + // use simply std::c14::plus<>() ... + template struct plus: std::plus{}; + + template<> struct plus { + template + auto operator()( T&& t, U&& u) const DECL_AND_RETURN(std::forward(t) + std::forward(u)); + }; + + template + std::unique_ptr make_unique(Args&&... args) { return std::unique_ptr(new T(std::forward(args)...)); } + + } +} + + +#endif +