3 ms·
It is in the C++14 standard: For every init-capture a non-static data member named by the identifier of the init-capture is declared in the closure type. This
by matt42 12y ago
It is in the C++14 standard:
For every init-capture a non-static data member named by the identifier of the init-capture is declared in the closure type. This member is not a bit-field and not mutable.
http://isocpp.org/files/papers/N3648.html http://isocpp.org/files/papers/N3648.html
- thwest 12y agoActually the member can still be declared `private:` and the `obj.a.name` would not be portable. It appears GCC's implementation to make these members `public:` is conforming to c++11 but do not rely on this behavior. I've been told in ##C++ that the current C++14 draft says: `An init-capture behaves as if it declares and explicitly captures a variable of the form “auto init-capture ;” whose declarative region is the lambda-expression’s compound-statement` This change would make the named member access non-conforming