summaryrefslogtreecommitdiff
path: root/src/mongo/util/functional.h
Commit message (Collapse)AuthorAgeFilesLines
* SERVER-62498 Non-`const` `unique_function` should not convert to ↵Casey Carter2022-04-041-0/+2
| | | | | | | | | | | | `std::function` even after LWG-2774 [LWG-2774](https://wg21.link/lwg2774) changes `std::function`'s converting constructor to accept its argument by forwarding reference. With that change implemented, that constructor becomes a better match for non-`const` `unique_function` arguments than `unique_function`'s `const`-qualified deleted conversion operator template to `std::function`. As a result, `std::is_convertible_v<unique_function<T>, std::function<T>>` changes from `false` to `true` when Standard Libraries implement LWG-2774. (MSVC recently implemented this LWG issue in https://github.com/microsoft/STL/pull/2098 and noticed the `unique_function` test failing as a result.) I believe the fix is to add another deleted conversion operator template that is not `const`-qualified to `unique_function`. This makes the test pass locally, as well as correcting a simplified test case with GCC trunk (https://github.com/microsoft/STL/pull/2098) which I believe also implements LWG-2774. Closes https://github.com/mongodb/mongo/pull/1437 Signed-off-by: Blake Oler <blake.oler@mongodb.com> and Billy Donahue <billy.donahue@mongodb.com>
* SERVER-63476 Remove extra ellipsis in function_ref implMathias Stearn2022-04-011-2/+2
|
* SERVER-63476 Add function_ref and stdx::remove_cvref_tMathias Stearn2022-03-291-14/+115
|
* SERVER-62324 Fix unique_function issues in C++20 mode with VS 2022Andrew Morrow2022-01-051-1/+1
|
* SERVER-40686 deduction guides for unique_functionJason Carey2019-07-101-0/+24
| | | | Add deduction guides for unique_function
* SERVER-39879 Fix unique_function constructor selection issuesBen Caimano2019-05-271-1/+2
|
* SERVER-39560 - remove leading blank line on all C++ filesBilly Donahue2019-02-131-1/+0
| | | | | | Remove leading comments that are just stating the filename. Move any file-level comments below the copyright banner. Remove leading blank lines.
* SERVER-35682 kill existing SharedPromise typeMathias Stearn2018-11-151-2/+2
| | | | This required plumbing unique_function into many more places.
* SERVER-37651 Update header files with new licenseRamon Fernandez2018-10-221-14/+16
|
* SERVER-37075 Make `unique_function<...>::nil` not break on MacOSADAM David Alan Martin2018-09-111-13/+15
| | | | | Some MacOS headers `#define nil`, because of Objective-C[++]. Use, instead, a name for the internal dummy argument that won't collide.
* SERVER-36900 Add a `unique_function` utility.ADAM David Alan Martin2018-09-061-0/+186
The `mongo::unique_function` object is a move-only function object which is useful for capturing move-only lambdas (such as those with `std::unique_ptr` objects) into type-erased function objects that resemble `std::function`.