Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9943

Provide automatic generation of dictionaries for classes inheriting from std::array

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Won't Fix
    • Affects Version/s: 6.14/04
    • Fix Version/s: None
    • Component/s: I/O
    • Labels:
      None
    • Environment:

      Archlinux with gcc 8.2.1

    • Bug / Feature:
      Feature request
    • Severity:
      3 - Normal
    • Development:

      Description

      In my project I need to modify the behavior of std::array so that it accepts enum class subscripts instead of integers. To do so I inherit from std::array (I know the pitfalls in doing so) and override operator[].

      However, rootcling is not able to generate a dictionary for the derived class (call it MyArray) when it holds a custom class (call it MyClass):

       Warning in TStreamerInfo::Build: MyArray<MyClass>: base class array<MyClass,3> has no streamer or dictionary it will not be saved

      If I explicitly tell rootcling to generate the missing dictionary with this LinkDef line:

       #pragma link C++ class std::array<MyClass,3>+;

      then I get this error:

       Error: It is not necessary to explicitly select class array<MyClass,3>. I/O is supported for it transparently.

      The issue is discussed in more details in the Root forum.

        Attachments

          Activity

            People

            • Assignee:
              dpiparo Danilo Piparo
              Reporter:
              nmori Nicola Mori
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                PlannedEnd:
                PlannedStart:
                Actual End: