Feature Request: unique_function
未关闭
- 主要语言
- C++
- 星标
- 18.1k
- 派生
- 3.2k
- 平均合并
- 20 小时 36 分钟
- 30 天内合并 PR
- 1
描述
In absl, we already have `absl::bind_front`, which can bind move only objects (`std::unique_ptr` ... ) as parameters, but the `std::function` is limited to be only copy constructable, and thus we can't cast the result of `absl::bind_front(xxx, std::move(some_unique_ptr))` to it.
A move-only function (let's call it `unique_function`) may solve this.
Something like `fu2::unique_function` (https://github.com/Naios/function2 ), and chromium's `OnceCallback` ([https://chromium.googlesource.com/chromium/src.git/+/master/docs/callback.md#oncecallback_and-repeatingcallback]()), would be really nice to have.
贡献指南
评估
这个 Issue 还没有评估数据。