Lambda captures and member variables

前端 未结 1 679
梦毁少年i
梦毁少年i 2021-01-03 23:18

I was watching Herb Sutter\'s talk at the C++ and Beyond 2012 conference on Concurrency and he talks about creating a non-blocking wrapper class, which he calls concur

相关标签:
1条回答
  • 2021-01-04 00:16

    Member variables can never be captured by value. What's being captured by value is the implicit this pointer used to access them. Therefore, it's capturing a pointer by value, which means it captures this object (and its members) by reference.

    0 讨论(0)
提交回复
热议问题