Embarrassingly simple problem here. I am trying to use std::array and am tripping at the first hurdle with the error …
implicit instantiation of undefined template 'std::__1::array<char,10>'
The code that gives the error is shown below. I can work around it with std::map for now, but I’m sure the fix must be simple!!
enum p_t {
EMPTY = 0
,BORDER_L
// ...
,BORDER_BR
,DATUM
,NUMEL };
class PlotChars
{
array<char, p_t::NUMEL> charContainer;
// error on this ^ line:
// implicit instantiation of undefined template 'std::__1::array<char,10>'
};
My first guess would be that you simply forgot to:
…before trying to use the
arraytemplate. While you can (at least indirectly) use a few classes without including the headers (e.g., the compiler can create anstd::initializer_listfrom something like{1, 2, 3}without your including any headers) in most cases (includingstd::array) you need to include the header before using the class template.