Skip to content

Conversation

@doudou
Copy link
Member

@doudou doudou commented Dec 30, 2025

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)

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
Copy link

@pierrewillenbrockdfki pierrewillenbrockdfki left a 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.

@pierrewillenbrockdfki
Copy link

pierrewillenbrockdfki commented Jan 5, 2026

Some small comments:

  • One can configure a user-global gitignore file(property core.excludesfile in .gitconfig). On the other hand, i have seen people check in their IDEs files on accident because they did not know, adding them to the repositories gitignore prevents that from happening.
  • I try to bunch my whitespace changes into a separate commit, so people can just skip them. Not much of an issue here, i'd like to add. Where things get bad is mixing reordering stuff and actual changes, sometimes one needs to split the commit just to review the changed bits.
  • Lambdas are more efficient than std::bind

@pierrewillenbrockdfki
Copy link

pierrewillenbrockdfki commented Jan 5, 2026

Found a compile issue, investigating. https://github.com/rock-data-processing/data_processing-orogen-type_to_vector
This is due to a leaked using namespace that no longer exists, i'd guess. I am going to provide a fix over there. No need to wait for that package. rock-data-processing/data_processing-orogen-type_to_vector#5

Looks like nothing else broke, a very small check if our various runtime orchestrations tools still work came back positive.

Copy link
Member

@chhtz chhtz left a 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 ) ) );
Copy link
Member

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
Copy link
Member

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)

Comment on lines +43 to +45
#include <boost/bind/bind.hpp>

using namespace boost::placeholders;
Copy link
Member

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 ) ) );
Copy link
Member

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.

Copy link
Member

@chhtz chhtz left a 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.

@pierrewillenbrockdfki
Copy link

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.

@chhtz
Copy link
Member

chhtz commented Jan 6, 2026

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 amake. But if it is not possible to build this anymore, it should better be removed completely, right?

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.

5 participants