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

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -