Hi,
I am running into problems trying to use std::vector to make two-dimensional arrays in the ROOT interpreter. Why does the following not work from the ROOT prompt?
For most non-trivial use of stl container, it is recommended to use compiled code. And it is necessary to do so, if you are going to pass those stl containers to some of your compiled code.
For example, you could create a simple file ‘vectorDict.C’:
#include <vector>
#ifdef __CINT__
#pragma link C++ class vector<vector<double> >;
#endif
then do.L vectorDict.C+
Sorrowfully, resize still won’t work but you can create another small file (or you can merge into vectorDict.C): ‘quick.C’
#include <vector>
resize(std::vector<std::vector<double> >&vec,int n) { vec.resize(n); }
and then