Re: template class won't compile after adding a destructor
* James Kanze:
On Apr 3, 5:55 am, Ethan <ethan.li...@gmail.com> wrote:
//eylds.h
#ifndef _EYL_DS_H_
#define _EYL_DS_H_
#include <cstdlib>
#include <algorithm>
#include "crtp.h"
using eylcrtp::Comparable;
enum direction_t {LEFT=0, RIGHT=1};
template <class KeyType, class DataType> class AvlNode;
template <class KeyType, class DataType> class AvlTree;
typedef AvlNode<class KeyType, class DataType> NodeType;
What's this line supposed to mean? It doesn't correspond to any
C++ syntax I know. (Curiously, g++ seems to accept it without
an error message. Looks like a bug in g++ to me.)
Seems OK technically. As noted earlier, else-thread, by "litb", it's just use of
elaborated type identifiers. It's not a template typedef.
So, being technically OK, that part compiles fine with e.g. Comeau.
But some confusion that it would be a template typedef is probably the problem,
as "litb" noted.
Cheers & hth.,
- Alf
--
Due to hosting requirements I need visits to <url: http://alfps.izfree.com/>.
No ads, and there is some C++ stuff! :-) Just going there is good. Linking
to it is even better! Thanks in advance!