Skip to content
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

Implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 #1668

Closed
daixtrose opened this issue May 7, 2020 · 0 comments · Fixed by #1669
Closed

Implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 #1668

daixtrose opened this issue May 7, 2020 · 0 comments · Fixed by #1669

Comments

@daixtrose
Copy link
Contributor

Compiling with g++ (Ubuntu 9.2.1-17ubuntu1~18.04.1) 9.2.1 20191102 I obtain warnings of the kind

fmt/include/fmt/format.h:1504:59: warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Wdeprecated]
 1504 |     out = write_int(out, num_digits, get_prefix(), specs, [=](iterator it) {

IMHO the solution is to explicitly specify this in the capture list, e.g.

out = write_int(out, num_digits, get_prefix(), specs, [=, this](iterator it) {

PR follows in a minute.

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 a pull request may close this issue.

1 participant