[ROOT] Multiple inheritance

From: Troy D. Straszheim (troy@ifh.de)
Date: Mon Feb 09 2004 - 14:49:34 MET


Hi roottalk-

I have another one:

I have a smart pointer class (a simple one) and I would like to
multiply inherit a class from TObject and a vector of smart pointers to objects.  

So the smart pointer looks like this, very basic:
template <class T> class SmartPtr<T>;

and my class would look like this:

class MyClass : public vector<SmartPtr<SomeType> >, public TObject { ... };

I find that this gets through rootcint and compiles:

class MyClass : public vector<SomeType>, public TObject { ... };

But the first does not compile, with the following error:

RootDict.cxx:462: no matching function for call to `TBuffer::StreamObject(
   __gnu_cxx::__normal_iterator<SmartPtr<SomeType>*, std::vector<SmartPtr<SomeType>, 
   std::allocator<SmartPtr<SomeType> > > >&, const std::type_info&)'
/usr/local/root/include/TBuffer.h:199: candidates are: void 
   TBuffer::StreamObject(void*, const std::type_info&)
/usr/local/root/include/TBuffer.h:200:                 void 
   TBuffer::StreamObject(void*, const char*)
/usr/local/root/include/TBuffer.h:201:                 void 
   TBuffer::StreamObject(void*, TClass*)

Any ideas?

Thanks,

Troy Straszheim



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:05 MET