MStrechen's blog

By MStrechen, history, 9 years ago, In English

Hello everyone.

Does anyone knows why this 25250650 can't be compiled using GNU C++14, but is successfully compiled using C++11? Is there any reason?

  • Vote: I like it
  • +13
  • Vote: I do not like it

»
9 years ago, hide # |
 
Vote: I like it +31 Vote: I do not like it

That's because you haven't included the needed header file. std::accumulate is declared in <numeric>, not <algorithm> (Refer to CPP Reference). I'm not sure how it compiles in C++11, though.