2014-02-22 35 views

回答

2

預計:

§5.1.2條第7款

拉姆達表達的複合語句產生的函數調用操作符, 的函數體(8.4),但名稱查找的目的(3.4),通過使用(* this)(9.3.1), 來確定這個(9.3.2)的類型和值並且將非靜態類成員轉換成類成員訪問表達式,則考慮複合語句在lambda表達式的上下文中。 [例如:

struct S1 { 
    int x, y; 
    int operator()(int); 
    void f() { 
     [=]()->int { 
      return operator()(this->x + y); // equivalent to S1::operator()(this->x + (*this).y) 
     // this has type S1* 
     }; 
    } 
};