On May 1, 7:37 pm, "Victor Bazarov" <v.Abaza...@comAcast.net> wrote:
You just dumped it in one file and didn't even bother to see if it
compiles, didn't you? Well, if you don't want our help, that's fine.
[..]
BTW, after rearranging properly your code doesn't compile because
you forgot "::base" in one place. After adding that it should
compile fine. If it still doesn't compile with whatever compiler
you got, contact their tech support.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
I apologise in advance about the code not being compiled. I was in a
bit of a rush yesterday.
The code as it is now will compile in aCC 6.1.3.
If anyone has any ideas about the code, then I'd appreciate it.
#include <iostream>
// Defclass.h
//
class obj;
class defclass
{
public:
class base
{
public:
// base (base b);
base (defclass* p = 0);
defclass *m_ref;
};
friend class base;
};
defclass::base::base(defclass *p)
: m_ref(p)
{
}
//
// templateptr.h
template <class T>
class templateptr
: public defclass::base
{
public:
inline templateptr(T* p = 0);
};
template <class T>
inline
templateptr<T>::templateptr(T* p)
: defclass::base(p)
{
}
typedef templateptr<obj> obj_ptr;
//
// starter.h
class starter
{
public:
starter() {}
~starter() {}
obj_ptr p;
};
class obj
: public defclass
{
public:
obj() {}
~obj() {}
};
//
// main.cxx
int main(void)
{
starter s;
return 0;
}