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

RMakeUnique incomplete

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: master
    • Fix Version/s: 6.18/00
    • Component/s: Core Libraries
    • Labels:
      None
    • Environment:

      Compiler with -std=c++11
      (works just fine with >= c++14)

    • Development:

      Description

      While upgrading some code to make use of smart pointers, I noticed that RMakeUnique is incomplete. It can only handle "normal" variables. It doesn't work for arrays in C++11 mode.

      I wanted to replace

      Float_t *rV = new Float_t[nevt];
      

      with

      auto rV = std::make_unique<Float_t[]>(nevt);
      

      This fails to compile when using RMakeUnique and C++11.

      Would it be possible to replace ROOT's make_unique implementation with https://isocpp.org/files/papers/N3656.txt or https://github.com/abseil/abseil-cpp/blob/master/absl/memory/memory.h or any other complete implementation?

        Attachments

          Activity

            People

            • Assignee:
              dpiparo Danilo Piparo
              Reporter:
              5ec16ad4cd4ea320131c Wolf Behrenhoff
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Actual Start:
                Actual End: