c++ - Template class without a name -
c++ - Template class without a name -
i have class uses template, can't rid of error:
8:1: error: template class without name
my code follows:
#ifndef bst #define bst #include <utility> template <typename datatype> class bst { ... };
the error occurs @ class bst
i'm pretty sure datatype name. missing how templates work?
the preprocessor line
#define bst
is messing up.
change like:
#ifndef bst_h #define bst_h #include <utility> template <typename datatype> class bst { ... };
c++ class templates
Comments
Post a Comment