Closed meiry closed 1 year ago
Tring to compile your server in ubuntu :
/usr/bin/g++ -fdiagnostics-color=always -Wall -std=c++17 -O0 -g $(find /home/vagrant/ws28 -type f -iregex '.*\.cpp') -I//home/vagrant/libuv/include/ -I/home/vagrant/ws28/src -L/home/vagrant/libuv/build -luv -lssl -lcrypto -o /home/vagrant/ws28/ws.exe
getting :
home/vagrant/ws28/src/Headers.h: In instantiation of ‘void ws28::RequestHeaders::ForEach(const F&) const [with F = main()::<lambda(ws28::HTTPRequest&, ws28::HTTPResponse&)>::<lambda(const char*)>]’: /home/vagrant/ws28/echo.cpp:44:22: required from here /home/vagrant/ws28/src/Headers.h:37:34: error: no match for call to ‘(const main()::<lambda(ws28::HTTPRequest&, ws28::HTTPResponse&)>::<lambda(const char*)>) (const std::basic_string_view<char>&, const std::basic_string_view<char>&)’ 37 | f(p.first, p.second); | ~^~~~~~~~~~~~~~~~~~~ /home/vagrant/ws28/echo.cpp:44:37: note: candidate: ‘main()::<lambda(ws28::HTTPRequest&, ws28::HTTPResponse&)>::<lambda(const char*)>’ 44 | req.headers.ForEach([&](const char *key/*, const char *value*/){ | ^ /home/vagrant/ws28/echo.cpp:44:37: note: candidate expects 1 argument, 2 provided
I think the example server is outdated right now, should be using std::string_view
std::string_view
Tring to compile your server in ubuntu :
getting :