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

Replaced all occurences of deprecated auto_ptr by unique_ptr #198

Merged
merged 2 commits into from
Jan 16, 2017

Conversation

meyerj
Copy link
Member

@meyerj meyerj commented Jan 10, 2017

auto_ptr was deprecated in C++11. Removes compiler warnings when compiling with -std=c++11.
See http://en.cppreference.com/w/cpp/memory/auto_ptr.

@snrkiwi
Copy link
Contributor

snrkiwi commented Jan 14, 2017

So is C++11 a requirement now for RTT? If so, where is that documented?

@meyerj
Copy link
Member Author

meyerj commented Jan 14, 2017

No, it's not a requirement. With the patch RTT only uses unique_ptr if available (using Boost Config macros) and falls back to auto_ptr otherwise. The main reason is to avoid deprecated warnings in some compilers, especially GCC 5 or Clang with C++11 enabled. See https://travis-ci.org/orocos-toolchain/rtt/jobs/190786861 for an example.

Like some of the other PRs I submitted last week this patch is a consequence of the build errors and warnings revealed by the new Travis build matrix introduced in #195.

To our best knowledge the only PR that would raise the compiler version requirements to at least GCC 4.2 is #200, which removes the version check that enables or disables visibility support conditionally. But I don't think that anyone still uses older compilers or Boost versions. We recently verified successful compilation and that unit tests still pass for the current master branch in Ubuntu Lucid for #201 (gcc 4.4, Boost 1.40).

But you are right that using Boost Config for the check raises the minimum Boost version requirement to 1.50, which introduced the BOOST_NO_CXX11_SMART_PTR macro. Probably checking __cplusplus instead is the more backwards compatible solution. This would also affect #196 and #197.

Signed-off-by: Johannes Meyer <johannes@intermodalics.eu>
@meyerj
Copy link
Member Author

meyerj commented Jan 16, 2017

But you are right that using Boost Config for the check raises the minimum Boost version requirement to 1.50, which introduced the BOOST_NO_CXX11_SMART_PTR macro. Probably checking __cplusplus instead is the more backwards compatible solution. This would also affect #196 and #197.

I replaced Boost Config macros by __cplusplus > 199711L checks.

@meyerj meyerj merged commit bdf2d71 into orocos-toolchain:toolchain-2.9 Jan 16, 2017
@meyerj meyerj deleted the c++11-unique-ptr branch January 16, 2017 15:31
meyerj added a commit to meyerj/rtt that referenced this pull request Oct 25, 2017
…into rdt-toolchain-2.9-cherry-pick

Replaced all occurences of deprecated auto_ptr by unique_ptr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants