Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-17823

[C++] Prefer std::make_shared/std::make_unique over constructor with new

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 9.0.0
    • 10.0.0
    • C++

    Description

      Advantage: readabilty, exception safety and efficiency(only for shared_ptr).

      Cases that don't apply: When calling a private/protected constructor within class member function, make_shared/unique can't work.

      Attachments

        Activity

          People

            jinshang Jin Shang
            jinshang Jin Shang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 4.5h
                4.5h