-
Notifications
You must be signed in to change notification settings - Fork 1
chore: fix deprecations #21
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
base: master
Are you sure you want to change the base?
Conversation
boost/bind.hpp imports the placeholders at toplevel, which is a deprecated behaviour. Include boost/bind/bind.hpp instead and import the relevant namespaces when needed. Note that we should move to std::bind at some point
This actually breaks backward compatibility (technically) since I did not update the internal typekit - which is not used within Rock
We do ignore it explicitly since the place where this happens is a crash handler ... that the write does not go through properly is the least of our worries
pierrewillenbrockdfki
left a comment
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.
Looks good to me. I am going to try this locally on our CI package-set and probably also a bit of runtime-testing.
|
Some small comments:
|
|
Found a compile issue, investigating. https://github.com/rock-data-processing/data_processing-orogen-type_to_vector Looks like nothing else broke, a very small check if our various runtime orchestrations tools still work came back positive. |
chhtz
left a comment
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.
Thanks a lot for cleaning this up!
My suggestions for improvement can also be done separately. I think there is also a lot of boiler-plate code which can be avoided now (assuming at least C++11 is used to compile)
| PropertyBase* PropertyBag::find(const std::string& name) const | ||
| { | ||
| const_iterator i( std::find_if(mproperties.begin(), mproperties.end(), std::bind2nd(FindProp(), name ) ) ); | ||
| const_iterator i( std::find_if(mproperties.begin(), mproperties.end(), std::bind(FindProp(), placeholders::_1, name ) ) ); |
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.
One can avoid the bind by passing name to FindProp, or just using a lambda:
std::find_if(mproperties.begin(), mproperties.end(),
[](const base::PropertyBase *b1 ){return b1->getName() == name;} );
| return 0; | ||
| } | ||
|
|
||
| base::PropertyBase* PropertyBag::getProperty(const std::string& name) const |
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.
This seems to be the same as PropertyBag::find? Maybe have one function call the other (and mark it deprecated)
| #include <boost/bind/bind.hpp> | ||
|
|
||
| using namespace boost::placeholders; |
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.
Maybe it would be a good opportunity to also replace boost::bind by std::bind?
| Property<T>* getPropertyType(const std::string& name) const | ||
| { | ||
| const_iterator i( std::find_if(mproperties.begin(), mproperties.end(), std::bind2nd(FindPropType<T>(), name ) ) ); | ||
| const_iterator i( std::find_if(mproperties.begin(), mproperties.end(), std::bind(FindPropType<T>(), std::placeholders::_1, name ) ) ); |
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.
Same as with getProperty, I would simply use a lambda here.
chhtz
left a comment
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.
I'm getting errors like the following at the moment:
In file included from /WS/tools/rtt/rtt/typekit/RealTimeTypekitOperators.cpp:44:
/WS/tools/rtt/rtt/typekit/../types/OperatorTypes.hpp: In instantiation of ‘class RTT::types::UnaryOperator<RTT::internal::identity<int> >’:
/WS/tools/rtt/rtt/typekit/RealTimeTypekitOperators.cpp:120:18: required from here
/WS/tools/rtt/rtt/typekit/../types/OperatorTypes.hpp:58:90: error: no type named ‘argument_type’ in ‘struct RTT::internal::identity<int>’
58 | typedef typename internal::remove_cr<typename function::argument_type>::type arg_t;
| ^~~~~
/WS/tools/rtt/rtt/typekit/../types/OperatorTypes.hpp:59:88: error: no type named ‘result_type’ in ‘struct RTT::internal::identity<int>’
59 | typedef typename internal::remove_cr<typename function::result_type>::type result_t;
| ^~~~~~~~
/WS/tools/rtt/rtt/typekit/../types/OperatorTypes.hpp:67:45: error: no type named ‘result_type’ in ‘struct RTT::internal::identity<int>’
67 | internal::DataSource<result_t>* build( const std::string& op, base::DataSourceBase* a )
| ^~~~~
This is likely caused by not inheriting from (the deprecated) std::unary_function anymore.
You are still building the typekit; only the default has changed to not build it, an existing build directory will keep building the typekit until you change the option. |
You are right, rtt builds after deleting the existing build-directory and running |
I fixed most warnings related to the increase in C++ version (and boost as well). However, the PR disables the built-in typekit since it relies on type deduction that I did not want to resolve (and Rock should really not depend on that built-in typekit anyways)