orocos-toolchain / rtt

Orocos Real-Time Toolkit
http://www.orocos.org
Other
72 stars 79 forks source link

Fixed OperationInterfacePartFused for -std=c++11 builds with Boost 1.58 (master) #196

Closed meyerj closed 7 years ago

meyerj commented 7 years ago

The Boost unfused adapter accepts only LValue arguments, while in general operations can also have RValues as arguments (const references or temporaries). Without C++11 or for older Boost versions this was apparently not an issue and the necessary conversion have been done implicitly (?).

The solution applies the forward_adapter template to overcome this limitation as suggested in the Boost Fusion documentation.

This patch also reverts the USE_CPP11 macro usage for this file, as it did not use std::bind or any other C++11 feature anyway and the only effect was the namespace of placeholders (see https://github.com/orocos-toolchain/rtt/commit/35cd426b4fd93c14a597b6ae590cc45c2dd2d105). Maybe it was unintentionally that boost::bind was not replaced by std::bind in the USE_CPP11 section of OperationInterfacePartFused.hpp like in other files of that patch (#103). boost::arg<i> is a simpler solution than introducing the macro and use C++11 that also prevent namespace clashes without having to use boost::lambda.

Tested on Ubuntu Xenial with gcc 5.4, Boost 1.58 and -std=c++11 compile flag. This is the build error I got without this patch.

meyerj commented 7 years ago

I discussed this patch with @psoetens last week and he agreed with the solution.