-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
use c++ 17 lambda function for progress_callback2
#4159
Comments
The best way it create PR, it can be easily tested.
|
As a workaround, you can put your data in a local struct and access it via |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current Behavior
progress_callback2
is a function pointerIn my use case i need to use a c++ lambda function with capture as
progress_callback2
. Something like this:progressLambda
is another lambda function which i pass astd::optional<std::function>
But this wont work because of the capture
[&]
. It is apparently not possible to cast it to function pointerExpected Behavior
Being able to pass the lambda function
Suggested Fix
I managed to fix it replacing the type of
PROGRESS_FUNC2
to:I can make a PR for this but i want to be sure first that it would be something you would access.
I think it would be a breaking change because pointer function cannot be casted to std::function.
tesseract -v
No response
Operating System
No response
Other Operating System
No response
uname -a
No response
Compiler
No response
CPU
No response
Virtualization / Containers
No response
Other Information
No response
The text was updated successfully, but these errors were encountered: