C++14: Replace comments by '= delete'
Summary
Use C++11 deleted functions = delete;
syntax.
Rationale
Stricter enforcement of non copy-ability. Note that this grep actually found a minor bug in Modules/Adapters/OSSIMAdapters/src/otbRPCSolverAdapter.cxx
which implements deleted functions.
Implementation Details
Classes and files
Applications
Tests
Documentation
Additional notes
Copyright
The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement
Merge request reports
Activity
mentioned in merge request !131 (merged)
I think this can be done automatically with https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-delete.html and does not rely on grepping for comments.
+1 All C++14 features should be integrated in a automatic way in a feature branch and apply regularly. I've got scripts which apply clang-modernize that I've used in the past to introduce override keyword (@jinglada did the same and make a presentation about it during otb user day hack sessions).
I think we should start from this.
Note that it will be interesting to ask itk developers some tips about they did in itk 5.
I propose we work on merging the three C++14 MR I made with our normal process now. It will allow for separate code review and dashboard testing which is nice because these are rather large diffs. We can always run clang-tidy in the future to modernize even more.
Do you agree with this approach or would you rather close them and do one giant clang-tidy branch later? I agree grepping is a bit less elegant, but I think in that case the resulting diff is just as good, isn't it?
@poughov if you want to play with grep/find/sed, for a long time I want to rename all .txx in .hxx in OTB :)
Regarding the MR, +1 to automate this.It will ensure that filters source code remain consistent in the future.
In
itkMacros.h
, I see:ITK_DELETE_FUNCTION
ITK_DISALLOW_COPY_AND_ASSIGN
I can't remember if there used to be another one.
Regarding comments, I also agree this shouldn't be required. May be we can add a non copyable pedagogical comment in doxygen comments of non-copyable classes like I did in
otbOGRDataSourceWrapper.h
and in some other files:/** * ..... * \note This class has an entity semantics: \em non-copyable, nor \em * assignable. * ... */
Edited by Luc Hermittementioned in commit 14ec6868
added refactoring label
changed milestone to %7.0.0