I am new to VC++ 2012 and Lambada programming. I want use a local initialized varaible withint he Lambada code block.
In this section the compiler throws this errorCode:int _tmain(int argc, _TCHAR* argv[]) { uri_builder uri(L"http://*:2001/"); http_listener listener(uri.to_uri()); utility::string_t strPost = L""; ------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------- listener.support(methods::POST,[](http_request req) { std::cout << "Serving POST" << std::endl; req.extract_string(true).then([req](utility::string_t body) { std::wcout << body << std::endl; strPost = body; }); }); }
How can I overcome this problem, how can I use it across the whole function?Code:Error 3 error C3493: 'strPost' cannot be implicitly captured because no default capture mode has been specified




Reply With Quote
