c++ compiling: error: expected constructor, destructor or type conversion before '*' -
i have been doing research , have found few similar questions on stackoverflow talking visibility of types, doesn't seem same problem (or @ least that's think after hours working on it).
let's focus:
the problem
c++ compiler reports "abc.cpp:132: error: expected constructor, destructor, or type conversion before ‘*’ token"
the code problem reported
template <class c, class i> abc<c, i>::node * abc<c, i>::buscatreuiretornaminim(node **node) {     if (*node == null) return null;     if ((*node)->fesq != null) return buscatreuiretornaminim(&(*node)->fesq);     node *q = *node;     *node = *node->fdre;     return q; } the problem reported on first line, function header. far, understand problem when specifying 'node *' it's qualified don't see where's problem.
the rest of class definition
class abc { public:     abc(void) : arrel(null), numelements(0), altura(0) { }     void inserir(c pclau, pinfo);     void inordre(void);     consultar(c pclau);     c minim(void);     c maxim(void);     void esborrar(c pclau);  private:     class node {     public:         c clau;         info;         node *fesq;         node *fdre;          node(c pclau, pinfo, node *pfesq = null, node *pfdre = null) : clau(pclau), info(pinfo), fesq(pfesq), fdre(pfdre) { }     };      node *arrel;     node *actual;     int numelements;     int altura;      void inserir(c pclau, pinfo, node **node);     void inordre(node **node);     consultar(c pclau, node **node);     c minim(node **node);     c maxim(node **node);     void esborrar(c pclau, node **node);     node * buscatreuiretornaminim(node **node); }; on other hand, can ensure rest of functions functional. that's problem have dealt far.
any tip appreciated. in advance time.
a qualified type name includes template parameters must prefixed keyword typename : typename abc<c, i>::node *
you can read more about necessity of typename keyword here.
Comments
Post a Comment