Simple-Web-Server
Simple-Web-Server copied to clipboard
Cannot compile on VS2013 which may not have full C++ 11 support
Here are compile errors:
Error 62 error C2227: left of '->content' must point to class/struct/union/generic type D:\repo\Simple-Web-Server\http_examples.cpp 223 1 http_examples
but the source code is in fact very simple:
// Synchronous request examples
try {
auto r1 = client.request("GET", "/match/123");
cout << r1->content.rdbuf() << endl; // Alternatively, use the convenience function r1->content.string()
If readme can indicate the minimal MSVS edition SWS supports, that would be nice
I try to modify under VS2013:
//auto
std::shared_ptr<HttpClient::Response>
r1 = client.request("GET", "/match/123");
cout << r1->content.rdbuf() << endl; // Alternatively, use the convenience function r1->content.string()
but still compile error:
Error 1 error C2440: 'initializing' : cannot convert from 'void' to 'std::shared_ptr<SimpleWeb::ClientBaseSimpleWeb::HTTP::Response>' D:\repo\Simple-Web-Server\http_examples.cpp 225 1 http_examples
Hopefully, someone with MSVC background can answer this.
It works very well on MSVC 2015. Especially the newer variants. 2013 is pretty old, and likely wasn't fully compliant.