Replace auto_ptr by unique_ptr#1889
Replace auto_ptr by unique_ptr#1889aroffringa wants to merge 2 commits intoOpenLightingProject:masterfrom
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.
DaAwesomeP
left a comment
There was a problem hiding this comment.
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 |
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.
c26f5b8 to
4e6649c
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.
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.
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.
4e6649c to
efc6f15
Compare
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.