谁能解释一下“ self_( this, []( ... ) {} )”是如何工作的?
self_( this, []( ... ) {} )
struct Parent { std::shared_ptr<Parent> self_; Parent() : self_( this, []( ... ) {} ) {} operator std::shared_ptr<Parent>() const { return self_; } }
c++ lambda this initializer
c++ ×1
initializer ×1
lambda ×1
this ×1