I’m trying to do the following:
struct Code
{
GF2X generator;
vector<GF2X> codeWords;
};
vector<Code> allCodes;
However, I end up with this error:
error: template argument for 'template<class _Alloc> class std::allocator' uses local type 'main()::Code'|
I’m completely lost as to what this means. This is also my first time programming in C++.
In C++03 local classes (classes defined inside a function) cannot be used as template arguments. That restriction was lifted in C++11, but if your compiler does not have support for this feature you can always move the type definition outside of the function at namespace level.