-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace auto_ptr by unique_ptr #1889
base: master
Are you sure you want to change the base?
Conversation
The functions std::binary_function and std::mem_fun have been deprecated in C++11, and are removed in C++20. This pull request replaces them with more modern code. Together with OpenLightingProject#1889 this removes all warnings on recent compilers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you caught all of the instances of std::move()
and default initializations. I didn't skim through more than what you changed but I assume you would get compile errors if you missed anything.
I also assume there aren't any instances where these need to be std::shared_ptr
, but maybe @peternewman has a better idea of that.
Thanks for the review! An I saw also quite a lot of places where a I saw you approved the pull request, but I can't merge, so someone else would have to do that. |
Yeah this is what I meant but I agree that should be a separate pull.
That would most likely be @peternewman |
12136a2
to
8baabbe
Compare
The functions std::binary_function and std::mem_fun have been deprecated in C++11, and are removed in C++20. This pull request replaces them with more modern code. Together with OpenLightingProject#1889 this removes all warnings on recent compilers.
@peternewman thoughts on this PR? |
@peternewman Would you want to apply these changes at some point or should I throw away the branch? |
8baabbe
to
35d9df4
Compare
The functions std::binary_function and std::mem_fun have been deprecated in C++11, and are removed in C++20. This pull request replaces them with more modern code. Together with OpenLightingProject#1889 this removes all warnings on recent compilers.
@peternewman: I'd also vote for this PR. All those auto_ptr generate quite some compiler warnings by now |
Solve also all ambiguous constructor std::unique_ptr(NULL) calls and fix the linting warnings produces after the find-and-replace of (std::)auto_ptr by (std::)unique_ptr.
35d9df4
to
c26f5b8
Compare
@peternewman can you please merge this PR? |
The functions std::binary_function and std::mem_fun have been deprecated in C++11, and are removed in C++20. This pull request replaces them with more modern code. Together with OpenLightingProject#1889 this removes all warnings on recent compilers.
I think it's time to start replacing auto_ptr... it's in some of the header files, and auto_ptr is removed in c++20, which means that other projects that use ola can't be compiled in c++20 mode because of ola. It also solves a lot of warnings :).
This pull request solves also all ambiguous constructor std::unique_ptr(NULL) calls and fixes the linting warnings produces after the find-and-replace of (std::)auto_ptr by (std::)unique_ptr. I've also replaced unnecessary calls to release() by move construction/assignment where possible.