[Solved] Cannot use array with GCC


Because <array> got indirectly included from somewhere and you made the mistake of using namespace std, “array” in ErrorMessage refers to that name in the std namespace.
That is a class template, not a type – hence the error message.

Outside of value, its array is called value::array.
(The typedef value::array array in value is pointless; the name array still only exists in the class scope. You may as well have written typedef array array;.)

Write

class ErrorMessage
{
    value::array my_array;
};

In addition, don’t reuse standard names. It confuses everyone.

1

solved Cannot use array with GCC