Search code examples
c++templatestypedeftypename

How to typedef a template class with typdef name C++


I have this typedef:

typedef uint16_t MCPhysReg;

and I want to declare (in another file):

typedef MapVector<unsigned, MCPhysReg> ConsecRegsMap;

MapVector is a template class (from another file):

template<typename KeyT, typename ValueT,
         typename MapType = llvm::DenseMap<KeyT, unsigned>,
         typename VectorType = std::vector<std::pair<KeyT, ValueT> > >
class MapVector {
...
}

But I'm getting this error:

syntax error: missing ';' before '<'

any ideas?


Solution

  • So include that other file in this one, otherwise how would your compiler know at all what MapVector is?