Commit 2488a9d5 authored by pravic's avatar pravic Committed by Facebook Github Bot 6

Fix typo in docs/Function.md

Summary: Closes https://github.com/facebook/folly/pull/421

Reviewed By: yfeldblum

Differential Revision: D3413832

Pulled By: elliottneilclark

fbshipit-source-id: 7af1462c250c8d6b5d6f5dfcb3f3117dff7877c9
parent e967876f
......@@ -15,7 +15,7 @@ some_future.then(
{ foo_ptr->setX(x); }
);
```
This piece of code did not compile before `folly::Future` started using `folly::Function` insted of `std::function` to store the callback. Because the lambda captures something non-copyable (the `unique_ptr`), it is not copyable itself. And `std::function` can only store copyable callables.
This piece of code did not compile before `folly::Future` started using `folly::Function` instead of `std::function` to store the callback. Because the lambda captures something non-copyable (the `unique_ptr`), it is not copyable itself. And `std::function` can only store copyable callables.
The implementation of folly::Future did not make use of the copy-constructibility of `std::function` at any point. There was no benefit from the fact that the `std::function` is copy-constructible, but the fact that it can only wrap copy-constructible callables posed a restriction.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment