Skip to content

Conversation

@HeartLinked
Copy link
Contributor

No description provided.


std::unique_ptr<ReaderProperties> ReaderProperties::default_properties() {
return std::make_unique<ReaderProperties>();
return std::unique_ptr<ReaderProperties>(new ReaderProperties());
Copy link
Contributor

Choose a reason for hiding this comment

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

For this specific case is actually safe because it is single expression, immediately returned and no other allocations happening. But I thought we generally prefer to use make_unique for it's safety.

Copy link
Contributor

Choose a reason for hiding this comment

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

std::make_unique needs a public constructor, so it can't be used when constructor is marked to private.

@wgtmac wgtmac merged commit 7e99399 into apache:main Dec 1, 2025
10 checks passed
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.

5 participants