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
propagate const for pointer data members #13015
Conversation
A new Pull Request was created by @wmtan for CMSSW_8_0_X. It involves the following packages: DataFormats/Common @cmsbuild, @smuzaffar, @Dr15Jones, @davidlange6 can you please review it and eventually sign? Thanks. Following commands in first line of a comment are recognized
|
please test |
The tests are being triggered in jenkins. |
|
||
private: | ||
T* ptr_; | ||
edm::propagate_const<T*> ptr_; |
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.
Will this cause ROOT to generate an extra layer in the storage?
-1 >> Compiling /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2016-01-20-2300/src/FWCore/Utilities/src/DebugMacros.cc >> Compiling /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2016-01-20-2300/src/FWCore/Utilities/src/DictionaryTools.cc In file included from /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2016-01-20-2300/src/FWCore/PluginManager/src/PluginManager.cc:25: In file included from /tmp/cmsbuild/workspace/ib-any-integration/CMSSW_8_0_X_2016-01-20-2300/src/FWCore/PluginManager/interface/PluginManager.h:29: In file included from /afs/cern.ch/cms/sw/ReleaseCandidates/vol0/slc6_amd64_gcc493/external/tbb/44_20150728oss/include/tbb/concurrent_unordered_map.h:27: /afs/cern.ch/cms/sw/ReleaseCandidates/vol0/slc6_amd64_gcc493/external/tbb/44_20150728oss/include/tbb/internal/_concurrent_unordered_impl.h:277:57: error: call to implicitly-deleted copy constructor of 'std::pair > >' new(static_cast(&pnode->my_element)) T(tbb::internal::forward(t)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /afs/cern.ch/cms/sw/ReleaseCandidates/vol0/slc6_amd64_gcc493/external/tbb/44_20150728oss/include/tbb/internal/_concurrent_unordered_impl.h:1293:40: note: in instantiation of function template specialization 'tbb::interface5::internal::split_ordered_list > >, tbb::tbb_allocator > > > >::create_node > > >' requested here pnode = my_solist.create_node(order_key, tbb::internal::forward(value)); ^ you can see the results of the tests here: |
@Dr15Jones This PR is superseded by #13093, so I am closing it. |
This PR uses the propagate_const template for most pointers in the framework that are data members of classes or structs, and makes the knock on changes caused by this. This means that a const member function of the class will no longer be able to modify the data to which the pointer points. This PR is therefore a partial implementation of issue #12840. The member pointers in the framework that are not modified by this PR are:
Other minor changes made in a very few places in affected code:
a) a few boost::scoped_ptr changed to std::unique_ptr
b) a few std::auto_ptr changed to std::unique_ptr
c) iterator loops replaced by range based for loops
d) nullptr replaces 0 for pointers