[Boost-bugs] [Boost C++ Libraries] #5913: Boost.Asio interferes with C++0x-Lambdas having [this]-Capture on MSVC2010

Subject: [Boost-bugs] [Boost C++ Libraries] #5913: Boost.Asio interferes with C++0x-Lambdas having [this]-Capture on MSVC2010
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-09-19 16:34:17


#5913: Boost.Asio interferes with C++0x-Lambdas having [this]-Capture on MSVC2010
---------------------------------+------------------------------------------
 Reporter: boost@… | Owner:
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: None
  Version: Boost 1.46.1 | Severity: Problem
 Keywords: |
---------------------------------+------------------------------------------
 Short Code to reproduce the Problem:

 #include <boost/asio/io_service.hpp>

 {{{
 #!cpp
 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

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5913>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC