G
Grizlyk
Grizlyk wrote:
I need to point self class in template parameter, for example
template <
class Tptr,
class Tc_iterator
{
public:
virtual void add_befor(Tc_iterator&, const Tptr);
virtual ~Vcontainer(){}
};
template <
class Tptr,
class Tc_container
{
public:
virtual char next(const char is_check_bound=0);
Tc_container *container;
virtual ~Viterator(){}
};
class Tptr;
Viterator< Tptr, Vcontainer<Tptr,"Viterator"> > a;
How can we point to itself here: "Viterator" (after class "Viterator" has
been declared)?
We need only name of class in the case. It can be easy done for non-template
class
class X
{
public:
X* next; //I can do it
};
I need to point self class in template parameter, for example
template <
class Tptr,
class Tc_iterator
class Vcontainer
{
public:
virtual void add_befor(Tc_iterator&, const Tptr);
virtual ~Vcontainer(){}
};
template <
class Tptr,
class Tc_container
class Viterator
{
public:
virtual char next(const char is_check_bound=0);
Tc_container *container;
virtual ~Viterator(){}
};
class Tptr;
Viterator< Tptr, Vcontainer<Tptr,"Viterator"> > a;
How can we point to itself here: "Viterator" (after class "Viterator" has
been declared)?
We need only name of class in the case. It can be easy done for non-template
class
class X
{
public:
X* next; //I can do it
};