From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- third_party/function2/Readme.md | 14 +++++++------- third_party/function2/include/function2/function2.hpp | 8 ++++++++ third_party/function2/moz.yaml | 4 ++-- 3 files changed, 17 insertions(+), 9 deletions(-) (limited to 'third_party/function2') diff --git a/third_party/function2/Readme.md b/third_party/function2/Readme.md index d8d2bdc45e..7556e83e8e 100644 --- a/third_party/function2/Readme.md +++ b/third_party/function2/Readme.md @@ -63,7 +63,7 @@ Use `fu2::function` as a wrapper for copyable function wrappers and `fu2::unique The standard implementation `std::function` and `fu2::function` are convertible to each other, see [the chapter convertibility of functions](#convertibility-of-functions) for details. A function wrapper is declared as following: -```cpp +```c++ fu2::function // Return type ~^ ^ ^ ^ // Parameters ~~~~~|~~~~~| ^ @@ -98,7 +98,7 @@ fu2::function `fu2::function` and `fu2::unique_function` (non copyable) are easy to use: -```cpp +```c++ fu2::function fun = [] { // ... }; @@ -111,7 +111,7 @@ fun(); `fu2::unique_function` also works with non copyable functors/ lambdas. -```cpp +```c++ fu2::unique_function fun = [ptr = std::make_unique(true)] { return *ptr; }; @@ -127,7 +127,7 @@ otherfun(); A `fu2::function_view` can be used to create a non owning view on a persistent object. Note that the view is only valid as long as the object lives. -```cpp +```c++ auto callable = [ptr = std::make_unique(true)] { return *ptr; }; @@ -164,7 +164,7 @@ fu2::function_view view(callable); | fu2::unique_function | No | Yes | No | | std::function | Yes | Yes | Yes | -```cpp +```c++ fu2::function fun = []{}; // OK std::function std_fun = fun; @@ -197,14 +197,14 @@ struct my_capacity { The following code defines an owning function with a variadic signature which is copyable and sfo optimization is disabled: -```cpp +```c++ template using my_function = fu2::function_base; ``` The following code defines a non copyable function which just takes 1 argument, and has a huge capacity for internal sfo optimization. Also it must be called as r-value. -```cpp +```c++ template using my_consumer = fu2::function_base, true, false, void(Arg)&&>; diff --git a/third_party/function2/include/function2/function2.hpp b/third_party/function2/include/function2/function2.hpp index e6dfca072e..ffb82b5ef7 100644 --- a/third_party/function2/include/function2/function2.hpp +++ b/third_party/function2/include/function2/function2.hpp @@ -1828,6 +1828,14 @@ constexpr auto overload(T&&... callables) { } } // namespace fu2 +namespace std{ +template +struct uses_allocator< + ::fu2::detail::function, + Alloc +> : std::true_type {}; +} // namespace std + #undef FU2_DETAIL_EXPAND_QUALIFIERS #undef FU2_DETAIL_EXPAND_QUALIFIERS_NOEXCEPT #undef FU2_DETAIL_EXPAND_CV diff --git a/third_party/function2/moz.yaml b/third_party/function2/moz.yaml index f1f1376b9f..d4fd5a2043 100644 --- a/third_party/function2/moz.yaml +++ b/third_party/function2/moz.yaml @@ -10,9 +10,9 @@ origin: url: https://naios.github.io/function2/ - release: a354bd093d2b6e50c9325dbce84d20b4e77aabc6 (2023-11-04T12:44:54Z). + release: 43fc0ca473ecb081918709bd7d524d84c2ff8dce (2024-02-25T17:37:03Z). - revision: a354bd093d2b6e50c9325dbce84d20b4e77aabc6 + revision: 43fc0ca473ecb081918709bd7d524d84c2ff8dce license: BSL-1.0 license-file: LICENSE.txt -- cgit v1.2.3