Are function-local typedefs visible inside C++0x lambdas?

后端 未结 4 996
既然无缘
既然无缘 2021-01-11 13:27

I\'ve run into a strange problem. The following simplified code reproduces the problem in MSVC 2010:

template 
struct dummy
{
    static T f         


        
4条回答
  •  死守一世寂寞
    2021-01-11 13:59

    From n3000, 5.1.2/6,

    The lambda-expression’s compound-statement yields the function-body (8.4) of the function call operator, but for purposes of name lookup (3.4), … the compound-statement is considered in the context of the lambda-expression.

    Not surprisingly, the local type should be visible.

提交回复
热议问题