| 125 | struct item : item_base |
| 126 | { |
| 127 | item(int pri, Func f) : function_(std::move(f)) |
| 128 | { |
| 129 | priority_ = pri; |
| 130 | execute_ = [](std::shared_ptr<item_base>& p) |
| 131 | { |
| 132 | Func tmp(std::move(static_cast<item*>(p.get())->function_)); |
| 133 | p.reset(); |
| 134 | tmp(); |
| 135 | }; |
| 136 | } |
| 137 | |
| 138 | Func function_; |
| 139 | }; |