You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functions that take callbacks etc take their callback functions by reference instead of const reference. This prevents lambdas from being used without going through a secondary type. Additionally taking the functions by reference is misleading as you would never change a function object.
I would do a PR to fix this, but I don’t know how deep this rabbit hole would go…
Steps to Reproduce
Compile code that uses a lambda directly in these functions, e.g.
Fails to compile as it cannot convert an R value reference into an L value reference.
This could be resolved by taking the reference as const.
Expected behavior:
The code should compile and run as expected.
Actual behavior:
The code fails to compile as you are unable to pass an R value reference into a function that expects an L value reference. There is no reason these functions should be taken by l value reference over const reference which would allow r values to be passed also.
Reproduces how often:
100% of the time
Versions
ign-transport 4.0.0_3
Mac OSX: 10.14.3
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
The text was updated successfully, but these errors were encountered:
Original report (archived issue) by Trent Houliston (Bitbucket: TrentHouliston).
Prerequisites
Put an X between the brackets on this line if you have done all of the following:
Description
Functions that take callbacks etc take their callback functions by reference instead of const reference. This prevents lambdas from being used without going through a secondary type. Additionally taking the functions by reference is misleading as you would never change a function object.
I would do a PR to fix this, but I don’t know how deep this rabbit hole would go…
Steps to Reproduce
Compile code that uses a lambda directly in these functions, e.g.
Fails to compile as it cannot convert an R value reference into an L value reference.
This could be resolved by taking the reference as const.
Expected behavior:
The code should compile and run as expected.
Actual behavior:
The code fails to compile as you are unable to pass an R value reference into a function that expects an L value reference. There is no reason these functions should be taken by l value reference over const reference which would allow r values to be passed also.
Reproduces how often:
100% of the time
Versions
ign-transport 4.0.0_3
Mac OSX: 10.14.3
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
The text was updated successfully, but these errors were encountered: