I have a problem in creating a dictionary for an std::array containing a custom class I defined. I put together a simple reproducer (reproducer.tar.gz (700 Bytes)) so I refer to it in the following.
My code contains a MyClass, a MyArray class inheriting from std::array (originally I did this to define a custom operator, but I didn’t add these details to the reproducer), and a using directive for convenience:
using MyArrayOfMyClass = MyArray<MyClass>;
The reproducer code simply tries to write a MyArraoOfMyClass in a Root file, it can be compiled and executed with the commads:
rootcling -f Dict.cxx MyArrayOfMyClass.h LinkDef.h g++ -o test -I`root-config --incdir` main.cpp Dict.cxx `root-config --libs` ./test
When executing test I get this error:
Warning in TStreamerInfo::Build: MyArray<MyClass>: base class array<MyClass,3> has no streamer or dictionary it will not be saved
From it I thought I had to create the dictionary for the base class array<MyClass,3>. So fine, I added this line:
#pragma link C++ class std::array<MyClass,3>+;
to the LinkDef file, but then running rootcling generates this error:
Error: It is not necessary to explicitly select class array<MyClass,3>. I/O is supported for it transparently.
So as far as I understand I am missing the dictionary for a base class but I cannot create it since it should be “transparently supported”. I’m clearly messing up things in some way, probably related to std:array, but I can’t figure out how and how to fix it, so I’d appreciate any help.
_ROOT Version: 6.14.04
_Compiler: gcc 8.2.1