I am getting some strange behaviour with a C++11 std::array
. When I try to compile with std::array<std::tuple<int, float>, 6> myTuples;
as a member variable, I get these errors:
mingw32\4.7.2\include\c++\array:-1: In instantiation of 'struct std::array<std::tuple<int, float>, 6u>':
mingw32\4.7.2\include\c++\array:77: error: 'std::array<_Tp, _Nm>::_M_instance' has incomplete type
I'm not sure if any of this changes anything but the class it is in is a template class derived from another template class. The template parameter is an unsigned int
an determines the size of a protected std::array
in the base class, which I reference in the derived class using Base<param>::m_array;
. The derived class has various glm::vec3/dmat4/quat
types, and uses OpenGL fixed function glBegin(GL_QUADS);
stuff. I'm using SDL-1.2.15 to create an OpenGL context. I think most of that was irrelevant, but maybe not. I could paste code, but everything is interconnected, so it can only be compiled as a whole (which distributed between sources is around a thousand or so lines).
However, when I include this same line in this ideone example, in very similar circumstances, it compiles perfectly fine. I checked that it wasn't just my compiler (MinGW g++ version 4.7.2) by compiling the same on my compiler with command line g++ -Wall -std=c++11
Does anyone know why I might get these errors? I had some problems before with the compiler crashing while parsing std::array
assignment (using array = {{a,b,c}};
for a default parameter), but this time its a compiler error not crash.
As per requested, you forgot to include <tuple>
which is why the compiler complained of an incomplete type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With