abseil / abseil/abseil-cpp

Feature Request: unique_function

Open
#763 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
18.1k
Forks
3.2k
Avg merge
20h 36m
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.