Implicit instantiation of undefined template 'std::__1::array<int, 3>'

Hobbyist picture Hobbyist · Aug 9, 2013 · Viewed 14.1k times · Source

I copy and pasted this exact code, found here into my IDE, and got an error, I don't understand why it's happening and would like to learn why.

std::array<int, 3> a2 = {1, 2, 3}; // except after =

Answer

Potatoswatter picture Potatoswatter · Aug 9, 2013

Make sure to remember #include <array>

But if you don't include any standard headers, you should get a simpler error about std being undefined.