Hi, I have some problems with a template extension.
I wrote a cmap class as extension of std::map to have the constant operator[].
I have a class foo which contains a cmap<int, int> and I would like to store it to a root file:
class foo: public TObject {
pulic:
...
const cmap<int,int> & get_table () const { return map; }
foo (): TObject (), map("foo") {}
private:
cmap <int, int> map;
...
};
The point is that when I try to write the foo object to root I get an segmentation fault (in TEmulatedMapProxy::WriteMap () root v 5.04 with gcc 4). Using a standard map instead of cmad does not crash.
Do you have any idea?
cmap.h (5.44 KB)