[ROOT] rootcint, STL and missing streamers

From: Roger Moore (rwmoore@fnal.gov)
Date: Wed Aug 21 2002 - 22:30:09 MEST


Using ROOT v3.05.00 I've noticed a strange problem when using templated
classes containing STL vectors. Unless rootcint is passed a class which
inherits from the template using the specified parameter.

In my case the LinkDef.h file containing the lines:

#pragma link C++ class PhysicsObject;
#pragma link C++ class ObjectProcessor<PhysicsObject>;

Where 'ObjectProcessor' is a template class containing an STL list
pointers of the type of the template parameter (i.e. std::list<T*>).

This generates the following ROOTCINT errors:

Class allocator<PhysicsObject*>: Streamer() not declared
Class allocator<PhysicsObject*>: ShowMembers() not declared
Class allocator<PhysicsObject*>: Class_Name() and initialization object
not declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >: Streamer() not
declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >: ShowMembers() not
declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >: Class_Name() and
initialization object not declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >::iterator:
Streamer() not declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >::iterator:
ShowMembers() not declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >::reverse_iterator:
Streamer() not declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >::reverse_iterator:
ShowMembers() not declared

However if I add the line:

class Dummy001 : public ObjectProcessor<PhysicsObject> { };

at the start of the LinkDef.h file then all these errors go away.
Similarly I have to include this line for each instance of the template
that I want to create.

This seems to be a bug...

Roger



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:05 MET