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

enums as template parameter for template class

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 6.02.00
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      linux , using root version ROOT 5.99/02 (heads/master@90a5de7, Sep 05 2013, 12:49:01 on linuxx8664gcc)

    • Development:

      Description

      There appears to be a problem with using a strongly typed enum as a template parameter for a class template. For example, trying to create a TTree Branch of type MyNamespace::MyClass (see attached header for definition) from the prompt fails as illustrated below:

      root [0] MyNamespace::MyClass<MyNamespace::MyEnum::ZERO>* e = new MyNamespace::MyClass<MyNamespace::MyEnum::ZERO>();
      root [1] TMemFile file("init.root","RECREATE");
      root [2] TTree tree("init","init tree");
      root [3] tree.Branch("MyNamespace::MyClass<MyNamespace::MyEnum::ZERO>", "MyNamespace::MyClass<MyNamespace::MyEnum::ZERO>", &e)
      input_line_346:3:27: error: value of type 'int' is not implicitly convertible to 'MyNamespace::MyEnum'
      ((MyNamespace::MyClass<0>)obj)->ShowMembers((TMemberInspector*)args[0]);
      ^
      Error in <TClingCallFunc::make_wrapper>: Wrapper compile failed!
      Error in <TClingCallFunc::Exec(address, interpVal)>: Called with no wrapper, not implemented!
      (class TBranch *) 0x10cc5230

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              axel Axel Naumann
              Reporter:
              a8565281f751c893e5ef felipe anziani (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated: