# Problem with std::map and structure when stored in ROOT I/O streamer dictionary

**URL:** <https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852>\
**Category:** ROOT\
**Created:** [December 21, 2022, 6:48pm UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852 "2022-12-21T18:48:50Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javier\_Galan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/javier_galan/32/29662_2.png) [@Javier\_Galan](https://root-forum.cern.ch/u/Javier_Galan)\
**Post date:** [December 21, 2022, 6:48pm UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/1 "2022-12-21T18:48:50Z")

</div>

We have the following class definition, where we have a structure, `RelevantQuantity` and a `std::map <std::string, RelevantQuantity>`.

We manage to write to disk the class using `TRestDataSet::Export`, that implements the folowing:

```auto
        fDataSet.Snapshot("AnalysisTree", filename);

        TFile* f = TFile::Open(filename.c_str(), "UPDATE");
        this->Write();
        f->Close();

```

where `fDataSet` is a `ROOT::RDataFrame`.

The problem is that when trying to reopen the generated file we get an error:

```auto
root [0] TFile *f = new TFile("BabyIAXO_Micromegas_TrueWolter_Vacuum.root")
Fatal in <InitializeEx>: Could not load nor generate the dictionary for "pair<string,RelevantQuantity>", some element might be missing their dictionary (eg. enums)
aborting
#0 0x00007f1d971e42d7 in __GI___ waitpid (pid=4610, stat_loc=stat_loc
entry=0x7ffec0071808, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30
#1 0x00007f1d9716270f in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149
#2 0x00007f1d99e68153 in TUnixSystem::StackTrace() () from /programas/root/6.26.06/lib/libCore.so
#3 0x00007f1d99d48ef2 in DefaultErrorHandler(int, bool, char const*, char const*) () from /programas/root/6.26.06/lib/libCore.so
#4 0x00007f1d99dfa82f in ErrorHandler () from /programas/root/6.26.06/lib/libCore.so
#5 0x00007f1d99dfb2c2 in Fatal(char const*, char const*, ...) () from /programas/root/6.26.06/lib/libCore.so
#6 0x00007f1d99919fcf in TGenCollectionProxy::InitializeEx(bool) () from /programas/root/6.26.06/lib/libRIO.so
#7 0x00007f1d99915df3 in TGenCollectionProxy::GetValueClass() const () from /programas/root/6.26.06/lib/libRIO.so
#8 0x00007f1d99e0e867 in TClass::GetClass(char const*, bool, bool, unsigned long, unsigned long) () from /programas/root/6.26.06/lib/libCore.so
#9 0x00007f1d99931a9b in TStreamerInfo::BuildCheck(TFile*, bool) () from /programas/root/6.26.06/lib/libRIO.so
#10 0x00007f1d998e0201 in TFile::ReadStreamerInfo() () from /programas/root/6.26.06/lib/libRIO.so
#11 0x00007f1d998eb124 in TFile::Init(bool) () from /programas/root/6.26.06/lib/libRIO.so
#12 0x00007f1d998ecad5 in TFile::TFile(char const*, char const*, char const*, int) () from /programas/root/6.26.06/lib/libRIO.so
#13 0x00007f1d8f52905e in ?? ()
#14 0x000055c1a5ce47d0 in ?? ()
#15 0x000055c1a7bfb050 in ?? ()
#16 0x000055c1a530dc00 in ?? ()
#17 0x00007f1d8f52803b in ?? ()
#18 0x00007f1d998ec200 in ?? () from /programas/root/6.26.06/lib/libRIO.so
#19 0x00007f1d915d3c1a in cling::IncrementalExecutor::runStaticInitializersOnce(cling::Transaction&) () from /programas/root/6.26.06/lib/libCling.so
#20 0x00007f1d9155b9e8 in cling::Interpreter::executeTransaction(cling::Transaction&) () from /programas/root/6.26.06/lib/libCling.so
#21 0x00007f1d915e479a in cling::IncrementalParser::commitTransaction(llvm::PointerIntPair<cling::Transaction*, 2u, cling::IncrementalParser::EParseResult, llvm::PointerLikeTypeTraits<cling::Transaction*>, llvm::PointerIntPairInfo<cling::Transaction*, 2u, llvm::PointerLikeTypeTraits<cling::Transaction*> > >&, bool) () from /programas/root/6.26.06/lib/libCling.so
#22 0x00007f1d915e60cb in cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) () from /programas/root/6.26.06/lib/libCling.so
#23 0x00007f1d9155eeaa in cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) [clone .constprop.548] () from /programas/root/6.26.06/lib/libCling.so
#24 0x00007f1d9155f1de in cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**, bool) () from /programas/root/6.26.06/lib/libCling.so
#25 0x00007f1d91630048 in cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) () from /programas/root/6.26.06/lib/libCling.so
#26 0x00007f1d91475b3c in HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /programas/root/6.26.06/lib/libCling.so
#27 0x00007f1d9148ac0f in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /programas/root/6.26.06/lib/libCling.so
#28 0x00007f1d99d27728 in TApplication::ProcessLine(char const*, bool, int*) () from /programas/root/6.26.06/lib/libCore.so
#29 0x00007f1d98b89d80 in TRint::ProcessLineNr(char const*, char const*, int*) () from /programas/root/6.26.06/lib/libRint.so
#30 0x00007f1d98b8a173 in TRint::HandleTermInput() () from /programas/root/6.26.06/lib/libRint.so
#31 0x00007f1d99e69c7b in TUnixSystem::CheckDescriptors() () from /programas/root/6.26.06/lib/libCore.so
#32 0x00007f1d99e6b7b8 in TUnixSystem::DispatchOneEvent(bool) () from /programas/root/6.26.06/lib/libCore.so
#33 0x00007f1d99d8bb21 in TSystem::Run() () from /programas/root/6.26.06/lib/libCore.so
#34 0x00007f1d99d24a22 in TApplication::Run(bool) () from /programas/root/6.26.06/lib/libCore.so
#35 0x00007f1d98b8bb76 in TRint::Run(bool) () from /programas/root/6.26.06/lib/libRint.so
#36 0x000055c1a3befda3 in main ()
Aborted

```

I had a look here in case it was something related with `LinkDef`,

> [@Can't use the dictionary for an enum class inside a namespace without the rootmap](https://root-forum.cern.ch/t/cant-use-the-dictionary-for-an-enum-class-inside-a-namespace-without-the-rootmap/34481/5):
>
> In the dictionary source file I see the enum class mentioned only in TriggerDictionaryInitialization\_libMyEnumDict\_Impl, in this section: static const char\* classesHeaders[]={ "NS::MyEnum", payloadCode, "@", nullptr}; That string is then used as argument for TROOT::RegisterModule: TROOT::RegisterModule("libMyEnumDict", headers, includePaths, payloadCode, fwdDeclCode, TriggerDictionaryInitialization\_libMyEnumDict\_Impl, {}, classesHeaders, /\*has no C++ module\*/false); I can’t u…

but we include the line `#pragma link C++ struct RelevantQuantity;` inside our LinkDef file.

Also, if I open the file in the same ROOT session as the session where the file was generated, there are no issues!

```auto
root [0] TRestDataSet d("dataset2.rml")
(TRestDataSet &) Name: BabyIAXO Title: Default TRestDataSet
root [1] d.Initialize()
root [2] d.Export("BabyIAXO_Micromegas_TrueWolter_Vacuum.root")
root [3] TFile *f = new TFile("BabyIAXO_Micromegas_TrueWolter_Vacuum.root")
(TFile *) 0x7f1bec001b10
root [4] .ls
TFile** BabyIAXO_Micromegas_TrueWolter_Vacuum.root	BabyIAXO_Micromegas_TrueWolter_Vacuum.root
 TFile* BabyIAXO_Micromegas_TrueWolter_Vacuum.root	BabyIAXO_Micromegas_TrueWolter_Vacuum.root
  KEY: TTree	AnalysisTree;1	AnalysisTree
  KEY: TRestDataSet	BabyIAXO;1	Default TRestDataSet
root [5] BabyIAXO->PrintMetadata()
                                            ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                                            
                                            || TRestDataSet content ||                                            
                                            || Config file : dataset2.rml ||                                            
                                            ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                                            
                                            || Name : BabyIAXO ||                                            
                                            || Title : Default TRestDataSet ||                                            
                                            || REST Version : 2.3.14 ||                                            
                                            || REST Official release: Yes ||                                            
                                            || Clean state: Yes ||                                            
                                            || REST Commit : 5f19f747 ||                                            
                                            || REST Library version : 0 ||                                            
                                            ----------------------------------------------------------------------------------------------------                                            
                                            || - StartTime : 16.85 ||                                            
                                            || - EndTime : 9.36111 ||                                            
                                            || - Path : /storage/iaxo/simulations/ray-tracing ||                                            
                                            || - File pattern : run_006*rayTrac*_Vacuum_jgalan_V2.3.14.root ||                        

```

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 21, 2022, 6:51pm UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/2 "2022-12-21T18:51:36Z")

</div>

At least:

`#pragma link C++ class RelevantQuantity+;`  
`#pragma link C++ class std::pair<std::string, RelevantQuantity>+;`  
`#pragma link C++ class std::map<std::string, RelevantQuantity>+;`

---

<div class="post-metadata">

**Author:** ![Javier\_Galan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/javier_galan/32/29662_2.png) [@Javier\_Galan](https://root-forum.cern.ch/u/Javier_Galan)\
**Post date:** [December 21, 2022, 6:58pm UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/3 "2022-12-21T18:58:35Z")

</div>

That didn’t help. It should be `class` or `struct`?

Also, even if the error message states `pair`, the data member is of type `std::map`.

We have used previously data members such as `std::vector <MyStructure>` and we did not experienced problems. EDIT: Ok, perhaps we did not have problems because the member was marked as `//!` 🙂

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 21, 2022, 7:01pm UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/4 "2022-12-21T19:01:09Z")

</div>

Well, I forgot the “map” (now added in my previous post).

For the “vector”, you would need:

`#pragma link C++ class MyStructure+;`  
`#pragma link C++ class std::vector<MyStructure>+;`

---

<div class="post-metadata">

**Author:** ![Javier\_Galan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/javier_galan/32/29662_2.png) [@Javier\_Galan](https://root-forum.cern.ch/u/Javier_Galan)\
**Post date:** [December 21, 2022, 7:03pm UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/5 "2022-12-21T19:03:46Z")

</div>

I see, still the error is there, my LinkDef file looks as follows now:

```auto
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ nestedclasses;
#pragma link C++ nestedclasses;
#pragma link C++ class RelevantQuantity+;
#pragma link C++ class std::pair<std::string, RelevantQuantity>+;
#pragma link C++ class std::map<std::string, RelevantQuantity>+;
#pragma link C++ class TRestDataSet+;
#endif

```

But I don’t understand why when I open the file in the same session there is no problems, and if I go out `.q` and enter again, trying to open the file fails.

---

<div class="post-metadata">

**Author:** ![Javier\_Galan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/javier_galan/32/29662_2.png) [@Javier\_Galan](https://root-forum.cern.ch/u/Javier_Galan)\
**Post date:** [December 21, 2022, 7:06pm UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/6 "2022-12-21T19:06:30Z")

</div>

Ok, I found out why.

I had to `#include <TRestDataSet.h>` before opening the file.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 21, 2022, 7:07pm UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/7 "2022-12-21T19:07:20Z")

</div>

Twice “`nestedclasses`”?  
You probably wanted one “`nestedtypedef`” here.

---

<div class="post-metadata">

**Author:** ![Javier\_Galan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/javier_galan/32/29662_2.png) [@Javier\_Galan](https://root-forum.cern.ch/u/Javier_Galan)\
**Post date:** [December 21, 2022, 7:09pm UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/8 "2022-12-21T19:09:09Z")

</div>

> [@Wile\_E\_Coyote](#):
>
> You probably wanted one “`nestedtypedef``” there.

Maybe, I will fix.

@pcanal However, it is kind of funny. Now I have removed the additional #pragma including the `RelevantQuantity` and it opens the file without problems as soon as I `#include <TRestDataSet.h>` header just before.

```auto
root [0] #include <TRestDataSet.h>
root [1] TFile *f = new TFile("BabyIAXO_Micromegas_TrueWolter_Vacuum.root")
(TFile *) 0x55b28e72ca50
root [2] 

```

So, finally are those `pragma` lines not necessary?

---

<div class="post-metadata">

**Author:** ![Javier\_Galan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/javier_galan/32/29662_2.png) [@Javier\_Galan](https://root-forum.cern.ch/u/Javier_Galan)\
**Post date:** [December 21, 2022, 7:27pm UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/10 "2022-12-21T19:27:01Z")

</div>

Ok, I was just not sourcing the most recent compilation. Adding the `pragma` lines solved the problem.

@pcanal But it seems that doing `#include <TRestDataSet.h>` solves also the problem without having to add the pragma lines.

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [December 21, 2022, 9:20pm UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/11 "2022-12-21T21:20:02Z")

</div>

Apriori you just need to use:

```auto
#ifdef __ROOTCLING__
#pragma link C++ class RelevantQuantity+;
#pragma link C++ class std::map<std::string, RelevantQuantity>+;
#pragma link C++ class TRestDataSet+;
#endif

```

Some older version of ROOT requires the addition of:

```auto
#pragma link C++ class std::pair<std::string, RelevantQuantity>+;

```

Then creating a dictionary and including in a shared library than is then accessible/visible from `LD_LIBRARY_PATH`, should be sufficient.

> But it seems that doing `#include \<TRestDataSet.h\>

It should not solve the problem by itself (it would be missing the I/O information for the `map`).

Which version of ROOT are you using? With and then without the include, what does `TClass::GetClass("TRestDataSet")->IsLoaded()` return (you may also have to check against `nullptr`)

---

<div class="post-metadata">

**Author:** ![Javier\_Galan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/javier_galan/32/29662_2.png) [@Javier\_Galan](https://root-forum.cern.ch/u/Javier_Galan)\
**Post date:** [December 22, 2022, 9:29am UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/12 "2022-12-22T09:29:25Z")

</div>

Compiling with LinkDef including `#pragma link C++ class std::map<std::string, RelevantQuantity>+;`, I get the following:

```auto
root [0] TClass::GetClass("TRestDataSet")
(TClass *) 0x55e5a24c2e60
root [1] TClass::GetClass("TRestDataSet")->IsLoaded()
(bool) true
root [2] 

```

Of course, same result if on top of that I add `#include <TRestDataSet.h>`, and opens the file properly.

If I remove the lines that contain `RelevantQuantity` and recompile, then same result, but I get problems reading the file.

```auto
root [0] TClass::GetClass("TRestDataSet")
(TClass *) 0x557708422a90
root [1] TClass::GetClass("TRestDataSet")->IsLoaded()
(bool) true
root [2] TFile *f = new TFile("BabyIAXO_Micromegas_TrueWolter_Vacuum.root")
Fatal in <InitializeEx>: Could not load nor generate the dictionary for "pair<string,RelevantQuantity>", some element might be missing their dictionary (eg. enums)
aborting

```

However, if I include `#incllude <TRestDataSet.h>` just before `TFile`, it opens the file without warnings.

---

<div class="post-metadata">

**Author:** ![Javier\_Galan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/javier_galan/32/29662_2.png) [@Javier\_Galan](https://root-forum.cern.ch/u/Javier_Galan)\
**Post date:** [December 22, 2022, 10:51am UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/13 "2022-12-22T10:51:44Z")

</div>

```auto
root-config --version
6.26/06

```

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [December 22, 2022, 11:33pm UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/14 "2022-12-22T23:33:20Z")

</div>

> [@Javier\_Galan](#):
>
> If I remove the lines that contain `RelevantQuantity` and recompile, then same result, but I get problems reading the file.

Since you are storing a `std::map<std::string, RelevantQuantity>`, you **need** to have the dictionary for `RelevantQuantity` and thus those lines are required.

---

<div class="post-metadata">

**Author:** ![Javier\_Galan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/javier_galan/32/29662_2.png) [@Javier\_Galan](https://root-forum.cern.ch/u/Javier_Galan)\
**Post date:** [December 23, 2022, 9:48am UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/15 "2022-12-23T09:48:13Z")

</div>

I understand, the problem is solved, just giving you feedback from the last question you asked. Still we don’t understand why when I `#include <TRestDataSet.h>` the dictionary is not necessary inside `LinkDef`.

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [December 23, 2022, 11:12am UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/16 "2022-12-23T11:12:13Z")

</div>

I think I understand why " `#include <TRestDataSet.h>`" works.  
There is the following inside:  
`std::map<std::string, RelevantQuantity> fQuantity; //<`  
so Cling will automatically JIT compile the needed dictionary info.

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [December 23, 2022, 3:53pm UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/17 "2022-12-23T15:53:43Z")

</div>

The dictionary contains 2 types of information. One is a summary of the class layout information and the other are accelerator functions/accessors (also knows as CollectionProxy) for STL containers. With just the header files ROOT can (slight slower than with the dictionary) acquire the information but does not yet automatically generate the CollectionProxy. So currently I/O of “Interpreted classes” (having just loaded the header) works in a lot of cases but not all and thus is not officially supported yet.

---

<div class="post-metadata">

**Author:** ![Javier\_Galan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/javier_galan/32/29662_2.png) [@Javier\_Galan](https://root-forum.cern.ch/u/Javier_Galan)\
**Post date:** [December 24, 2022, 11:38am UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/18 "2022-12-24T11:38:02Z")

</div>

In case this is useful to any future root user, we fixed this by adding a piece of code at our `MacroRootDict` that automatically adds the required lines to our `LinkDef` automatically generated files.

> <https://github.com/rest-for-physics/framework/pull/356>
>
> !\[jgalan\](https://badgen.net/badge/PR%20submitted%20by%3A/jgalan/blue) !\[Ok: 49\]…(https://badgen.net/badge/PR%20Size/Ok%3A%2049/green) \[!\[\](https://gitlab.cern.ch/rest-for-physics/framework/badges/jgalan\_add\_std\_to\_dictionary/pipeline.svg)\](https://gitlab.cern.ch/rest-for-physics/framework/-/commits/jgalan\_add\_std\_to\_dictionary) \[!\[\](https://github.com/rest-for-physics/framework/actions/workflows/validation.yml/badge.svg?branch=jgalan\_add\_std\_to\_dictionary)\](https://github.com/rest-for-physics/framework/commits/jgalan\_add\_std\_to\_dictionary)
> 
> Now, the dictionary for structures will be added in the class that they are used with a \`std::\` list.
> 
> Extract from cmake output:
> 
> \`\`\`
> \-- Testing disabled (Disabled by default, enabled via -DTEST=ON flag)
> \-- /usr/bin/git submodule foreach git rev-parse --git-path hooks
> \-- Check for ROOT\_DICT\_OUTPUT\_DIR: /home/jgalan/rest-framework/build/rootdict
> \-- Check for ROOT\_DICT\_CINT\_DEFINITIONS: 
> \-- Begin of external dependencies
> \-- making build files for /home/jgalan/rest-framework/source/framework, schema evolution: 
> specified sub-dirs: external/tinyxml;tools;core;analysis;masks
> \-- Adding std::vector\<HistoInfoSet\> to the dictionary!
> \-- Adding std::map\<std::string, RelevantQuantity\> to the dictionary!
> \`\`\` 
> 
> This solves a problem that appeared when trying to read a \`TRestDataSet\`.
> 
> See also:
> https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [January 7, 2023, 11:38am UTC](https://root-forum.cern.ch/t/problem-with-std-map-and-structure-when-stored-in-root-i-o-streamer-dictionary/52852/19 "2023-01-07T11:38:28Z")

</div>

Closed on January 7, 2023, 11:38am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
