[PATCH rtems-tools v1] ReportsBase: Change raw pointer to unique_ptr

Chris Johns chrisj at rtems.org
Mon Dec 20 23:14:05 UTC 2021


On 21/12/21 10:08 am, Ryan Long wrote:
> On 12/20/2021 5:03 PM, Chris Johns wrote:
>> On 21/12/21 7:24 am, Ryan Long wrote:
>>
>>>     reportList_t           reportList;
>> Then make this `reports`.
>>
>>>     reportList_t::iterator ritr;
>>>     std::string            reportName;
>>> -  ReportsBase*           reports;
>>>     time_t                 timestamp;
>>>         timestamp = time( NULL ); /* get current cal time */
>>> -  reports = new ReportsText(
>>> +  reportList.emplace_back(new ReportsText(
>> Should `std::make_unique<ReportsText>(...)` be used?
> I was going to use this, but it was added in c++14.

Ak OK and thanks. I am using c++14 these days and had not noticed. I will leave
this with you.

Chris


More information about the devel mailing list