Use c++11 smart pointer #42
Manually merged
obache
merged 2 commits from feat/replace-smart-pointer-type
into master
4 months ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'feat/replace-smart-pointer-type'
Deleting a branch is permanent. It CANNOT be undone. Continue?
C++11 is allowed,
shared_ptr
unique_ptr
instead of deprecatedauto_ptr
26c0d5cda6
to0d168f7ecd
4 months ago0d168f7ecd
into master manually 4 months agoIt looks good. It was necessary to add CXX_FEATURES to make sure c++11 is selected on some old distros where gcc supports c++11 but not as default choice. I have pushed a commit on top of yours for that.
I will wait for @SlavekB to test building in some old distros before merging the PR.
Duh!! I mistakenly merged already :-(
@SlavekB I don't expect problems but before I backport this to R14.0.x could you do a build test on Xenial?
I did the test on Xenial, added one more commit for ensure at least C++11 and made a backport to r14.0.x branch.
Thanks! That is what I meant for originally, because there could have been a chance of missing CXX_FEATURES somewhere else that could be detected by building. Unfortunately, due to something I have to fix on my side, I pushed to master instead of the branch :-(.
From TDE/tde#73, I'm using
nullptr
in this PR, but is it not allowed by default yet?c++11 is allowed. We just need to add CXX_FEATURES in cmake files to make sure c++11 standard is selected by the compiler if it is not the default. This only affects old distros like Ubuntu Xenial, where gcc supports c++11 fully but does not set it as default.
So feel free to use any c++11 feature you wish :-)
CMAKE_CXX_STANDARD
is set as11
globally? or mixedstd
usage is troublesome.The
CMAKE_CXX_STANDARD
setting is a way that we do not want to use. The setting in this way causes to enforce the standard, regardless of whether the C++ compiler has the desired standard as a default and above all, regardless of whether it has as a default newer standard!Therefore, we chose the way of setting the required C++ features, for example
cxx_nullptr
,cxx_range_for
,… when CMake decides what version of C++ standard is necessary and whether it is necessary to add the desired build option or not.If we already want to focus on move forward in connection with TDE/tde#73, it will be appropriate to set
TDE_CXX_FEATURES
at the level of common TDE CMake module, instead of setting cxx features individually for libraries or applications. However, in this regard, we probably should first complete the conversion automake => cmake for the remaining modules.Completing conversion of automake to cmake first would definitely be good, but I think that will take a while. Instead I can see c++11 features being used more and more quickly, so I think we should go ahead and set CXX_FEATURES at common level in TDE.
CXX_FEATURES have been enabled at TDE level now. There is no longer any need to set them for individual modules or libraries.
Reviewers
0d168f7ecd
.