ROOT & STL

From: Alexander Zvyagin (zvyagin@mx.ihep.su)
Date: Tue Jan 26 1999 - 06:43:57 MET


                                           IHEP, Protvino, Russia, 26-JAN-1999

Dear ROOTers,

Are there any recomendations on how to create ROOT class that uses STL?
I plan to use class structure represented below, but may be somebody
have found better solution?

The problem "How to use STL with ROOT" was discussed many times
in roottalk. It is time to create ROOT-STL HOWTO.

------------------------------------
#ifndef RootSTL__include
#define RootSTL__include

#include "TObject.h"

#ifndef   __CINT__
// --- STL ---
#include <vector.h>
#include <pair.h>
#endif // __CINT__

class RootSTL : public TObject
{
  public:
   ~RootSTL(void) {}
    RootSTL(void) {}

#ifndef __CINT__
    vector<int> fVInt;                  // STL vector
    pair<bool,int> Sum(vector<int> &v); //
#define __CINT__
    
  ClassDef(RootSTL,1)           // ROOT class that uses STL
};

#endif // RootSTL__include
--------------------------------------

With best wishes,
Alexander.



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:28 MET