mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #466] can't use lambda expression for setSaveConfigCallback #393
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#393
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @liebman on GitHub (Dec 3, 2017).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/466
in my
setup()function I have:This fails with an error:
error: no matching function for call to 'WiFiManager::setSaveConfigCallback(setup()::__lambda1)'However I also have:
And this works!
Any ideas?
@DarkFox commented on GitHub (Dec 19, 2017):
You need to call it like this:
Since setSaveConfigCallback doesn't take any arguments.
@liebman commented on GitHub (Dec 19, 2017):
@DarkFox correct, I used this where save_config is a local variable:
It's supposed to capture the save_config variable so I don't need to make it global as its only used in this one function. Maybe its really a tool chain bug?
@DarkFox commented on GitHub (Dec 19, 2017):
Yeah, I was in the same situation. I decided to just make it a static on my wifi handling class. It's not like I've got multiples of it anyway. Though it is poor style.
@tablatronix commented on GitHub (Feb 1, 2018):
Should we not just add WiFiManager* to all callbacks?
@liebman commented on GitHub (Jun 19, 2018):
fixed with #584