Skip to content

Use make_unique for unique_ptr construction#2579

Merged
lballabio merged 2 commits into
lballabio:masterfrom
jewonj0620:feature/use-make-unique-ptr
May 19, 2026
Merged

Use make_unique for unique_ptr construction#2579
lballabio merged 2 commits into
lballabio:masterfrom
jewonj0620:feature/use-make-unique-ptr

Conversation

@jewonj0620
Copy link
Copy Markdown
Contributor

Mechanically replace raw new-based std::unique_ptr construction and reset(new ...) with std::make_unique.

@coveralls
Copy link
Copy Markdown

coveralls commented May 14, 2026

Coverage Status

coverage: 74.621% (+0.05%) from 74.573% — jewonj0620:feature/use-make-unique-ptr into lballabio:master

{
Real ss=0.0;
std::unique_ptr<double[]> xiv(new double[2048*2048+1]);
std::unique_ptr<double[]> xiv = std::make_unique<double[]>(2048*2048+1);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're modernizing I'd use auto for all these declarations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I changed the declarations to use auto in the files I modified first.

There are many other places that need to be updated to follow modern C++ practices. I will address them in several follow-up commits after this.
\

@lballabio lballabio merged commit e7ba4f7 into lballabio:master May 19, 2026
45 checks passed
@lballabio lballabio changed the title Use make_unique for unique_ptr construction Use make_unique for unique_ptr construction May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants