abseil / abseil/abseil-cpp

Feature Request: unique_function

Đang mở
#763 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
18.1k
Fork
3.2k
Merge trung bình
20 giờ 36 phút
Pull request đã merge (30 ngày)
1

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.