I want to specify a function with parameters for a function parameter, but it doesn't come together.
////////////////////////////////////////////////////////////////////////
// Example funch...
void fileLoad(String path, String type) {
file = SD.open(path.c_str(), FILE_READ);
server.streamFile(file, type) != file.size();
file.close();
}
// This is how I want to use it, but it's not possible:
server.on("/homepage", fileLoad("app/homepage.html", "text/html") );
////////////////////////////////////////////////////////////////////////
// Currently, as it works, you need 1 extra funch...:
void homepage() {
fileLoad("app/homepage.html", "text/html");
}
server.on("/homepage", homepage);
std::function
and so lambdas of the type that would be needed, so you could make that an answer.