Opened 11 years ago
Closed 11 years ago
#5913 closed Bugs (invalid)
Boost.Asio interferes with C++0x-Lambdas having [this]-Capture on MSVC2010
Reported by: | Owned by: | ||
---|---|---|---|
Milestone: | To Be Determined | Component: | None |
Version: | Boost 1.46.1 | Severity: | Not Applicable |
Keywords: | Cc: |
Description
Short Code to reproduce the Problem:
#include <boost/asio/io_service.hpp>
struct Data { int i; }; struct Foo { Data* data; void bar() { auto callback = [this]() { data->i = 5; }; } };
Gives an error on line 10:
error C2326: 'void `anonymous-namespace'::<lambda0>::operator ()(void) const': function can not access 'Foo::data'
removing the #include fixes the error as well as specifying the access by this->data->i = 5;
Setup used: MSVC2010 Ultimate with Boost 1.46.1
Change History (1)
comment:1 by , 11 years ago
Resolution: | → invalid |
---|---|
Severity: | Problem → Not Applicable |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Ok, I reduced the Problem to the following Code, so it's a MSVC bug: