Fix compile error in menu_motion when enabled FT_MOTION_MENU #27401
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There is a compile error in menu_motion.cpp when enabled
FT_MOTION_MENU
. The error message is:The error occurs at capturing the
c
in the lambda function due to it not using capture syntax[&]
.However, when using
[&]
, the new error occurs because it cannot be converted from<lambda()>
toscreenFunc_t
.This PR fixes the error by declaring the new reference
c
within lambda. That is the same reference as the upperc
.This code may not be optimal, for example it can change
ftMotion.cfg.active
directly without using thec
as before #26670. But I think it's readable to use thec
for consistency with other codes.Requirements
Benefits
Configurations
Related Issues