Skip to content
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

Use unique_ptr, not auto_ptr #13820

Merged
merged 1 commit into from Mar 28, 2016
Merged

Conversation

wmtan
Copy link
Contributor

@wmtan wmtan commented Mar 23, 2016

Replace almost all uses of std::auto_ptr with std::unique_ptr in the framework. Two packages outside the framework are minimally affected.
Other minor C++ improvements were made in a very few files that were modified anyway.
There are three places in the framework where use of std::auto_ptr remains in place for now, because
many packages outside the framework would have been affected. These are:
a) The put() interface, for Event, Run, and LuminosityBlock.
b) The interface to the EventSetup system
c) The use of OwnVector
These still support both auto_ptr and unique_ptr for now, and will be migrated solely to unique_ptr at a later time, if time permits.
Also, this PR adds the use of std::make_unique everywhere in the framework where it does not cause complications.
Unrelated to the above, I also fixed a few statements that had an extra semicolon at the end.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @wmtan for CMSSW_8_1_X.

It involves the following packages:

DataFormats/Common
FWCore/Framework
FWCore/Integration
FWCore/MessageService
FWCore/ParameterSet
FWCore/PluginManager
FWCore/ServiceRegistry
FWCore/Services
FWCore/Skeletons
FWCore/Sources
FWCore/Utilities
IOMC/Input
IOMC/RandomEngine
IOPool/Common
IOPool/Streamer
IOPool/TFileAdaptor
PhysicsTools/PatUtils
RecoLocalCalo/EcalRecProducers

@smuzaffar, @Dr15Jones, @cvuosalo, @cmsbuild, @slava77, @davidlange6 can you please review it and eventually sign? Thanks.
@TaiSakuma, @jdolen, @imarches, @makortel, @rappoccio, @mmarionncern, @wddgit, @argiro, @Martin-Grunewald, @ahinzmann, @nhanvtran, @schoef, @ferencek, @gpetruc, @mariadalfonso, @pvmulder, @acaudron this is something you requested to watch as well.
@slava77, @Degano, @smuzaffar you are the release manager for this.

cms-bot commands are list here #13028

@Dr15Jones
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/12034/console

template< typename T> struct OneHolder< std::auto_ptr<T> > {
typedef std::auto_ptr<T> Type;
template< typename T> struct OneHolder< std::unique_ptr<T> > {
typedef std::unique_ptr<T> Type;
OneHolder() {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we keep the auto_ptr and make another specialization for unique_ptr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Dr15Jones I don't know if auto_ptr is still needed, but to be safe, we'll keep it.

@cmsbuild
Copy link
Contributor

-1

Tested at: d96eae8
I found errors in the following unit tests:

---> test runtestTqafTopEventSelection had ERRORS

you can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-13820/12034/summary.html

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Pull request #13820 was updated. @smuzaffar, @Dr15Jones, @cvuosalo, @cmsbuild, @slava77, @davidlange6 can you please check and sign again.

@wmtan
Copy link
Contributor Author

wmtan commented Mar 26, 2016

@Dr15Jones Converted to std::make_unique everywhere in the core software where it made sense and did not cause a build error. I did not spend time investigating build errors caused by std::make_unique. I just did not use make_unique in those cases.

@wmtan
Copy link
Contributor Author

wmtan commented Mar 26, 2016

2cmsbuild please test

@Dr15Jones
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

-1

Tested at: c0684d0
I found errors in the following unit tests:

---> test runtestTqafTopEventSelection had ERRORS

you can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-13820/12071/summary.html

@cmsbuild
Copy link
Contributor

@wmtan
Copy link
Contributor Author

wmtan commented Mar 27, 2016

@cmsbuild @davidlange6 The test failure is in the base IB and has nothing to do with this PR.

@Dr15Jones
Copy link
Contributor

+1

@davidlange6 davidlange6 merged commit 50a3872 into cms-sw:CMSSW_8_1_X Mar 28, 2016
@wmtan wmtan deleted the UseUniquePtr branch May 26, 2016 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants