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
I'm trying to use fileManager for other purpose , but I'm getting lost with how to use the pointer . Can you help ?
It have something to do with "lambda expression". .. idk
WebServer *ws = filemgr.getWebServerPtr();
ws->on("/f", []() {
ws->setContentLength(CONTENT_LENGTH_UNKNOWN);
String res = "";
res->reserve(CTRLASSIST_STREAM_CHUNKSIZE);
while (ctrl.getHtmlChunk(res)) {
ws->sendContent(res);
}
});
Error :
src/UV_Timer_v4.cpp:836:5: error: 'ws' is not captured
ws->setContentLength(CONTENT_LENGTH_UNKNOWN);
^~
src/UV_Timer_v4.cpp:835:26: note: the lambda has no capture-default
ws->on("/d", [WebServer]() {
^
src/UV_Timer_v4.cpp:823:14: note: 'WebServer* ws' declared here
WebServer *ws = filemgr.getWebServerPtr();
^~
The text was updated successfully, but these errors were encountered:
For lambdas, it might become clearer if you do not use a lambda but a traditional approach with a function here. That should show what is needed to pass into the lambda. (that said, early in the morning without enough coffee.)
I'm trying to use fileManager for other purpose , but I'm getting lost with how to use the pointer . Can you help ?
It have something to do with "lambda expression". .. idk
Error :
The text was updated successfully, but these errors were encountered: