{"sha":"bc092d5b7384f21dc63db366d2f14cb9ec41e83f","node_id":"C_kwDOAiB0YNoAKGJjMDkyZDViNzM4NGYyMWRjNjNkYjM2NmQyZjE0Y2I5ZWM0MWU4M2Y","commit":{"author":{"name":"Sean Parent","email":"sean.parent@stlab.cc","date":"2024-02-23T02:02:01Z"},"committer":{"name":"GitHub","email":"noreply@github.com","date":"2024-02-23T02:02:01Z"},"message":"Some minor fixes (#537)\n\n* Minor bug fixes around operations that require mutability.\r\n* Replacing an incorrect identity function with std::identity{}\r\n* Removed unnecessary moves.","tree":{"sha":"bcf79aafafe87fa0a4fc73efc02951f42634612d","url":"https://api.github.com/repos/stlab/stlab/git/trees/bcf79aafafe87fa0a4fc73efc02951f42634612d"},"url":"https://api.github.com/repos/stlab/stlab/git/commits/bc092d5b7384f21dc63db366d2f14cb9ec41e83f","comment_count":0,"verification":{"verified":true,"reason":"valid","signature":"-----BEGIN PGP SIGNATURE-----\n\nwsFcBAABCAAQBQJl1/yZCRC1aQ7uu5UhlAAABIcQAFKUak1aoAQnYpE9/Yhm9iYl\nH/8Fw7Mc2Opbnd4i5A43rpmzXSDKTXG66ownPQeUUjYn3bX6sgOh2bolaxu7agK1\nWvpn7N1ih9xkfgHD80sk7gm5zzD5elhlRsK0C9i6ITAHoqslgIJiwwEySnOYCgFt\nLBcIiE/lOg7uxi4QOZ1OtEWwEufXz5ZNV6j1ImQPd/uTZhiaaMPcqkOw3SI7IEEI\nGnlnm3oKVNWvOUPdHsaAuqekAJEHSho54zEre7PdcBY/I2KDHgOqOv6GJEgp+gWK\nUE3gBLnGIaBdJlFkWHGbDowL1ussEuzyWcHYV3YIYs5pcfDB7Yb5D2R3DzrcladR\nt/SYLO/+M4dKeARB3rQSFZfVSyang1dG7o0jDqtC7aoafjv6Td+1KrKJqXMXltOb\nOp/Ib/KHg1P+Jpzasms8RWWm9LLbKM3ZO3hURfWJ56dJDMNvSBnkIO6bsJNDrS1T\nfMORKcB0d7kQh689EDN7DJ7YTrnUt60HANsq8CIR/HwCG3IaAOGTpDstPnu7ejLm\ngjGmedpe+jCUixHaKcbpxAXbo5vCzy+wAvkQKBPZIr3wMVvNlnltvgeatseTvjke\n3KzlJseOwP0nqC2bAgA3PTDE5X0aEQRQJbzDKsXOzLNSGMl1QcZxXUEQvmIn/gG3\n9JrKysTNmYmyce+kmXGd\n=gUJp\n-----END PGP SIGNATURE-----\n","payload":"tree bcf79aafafe87fa0a4fc73efc02951f42634612d\nparent c59cfaca42aeb883c7ec331918325584193c8f53\nauthor Sean Parent <sean.parent@stlab.cc> 1708653721 -0800\ncommitter GitHub <noreply@github.com> 1708653721 -0800\n\nSome minor fixes (#537)\n\n* Minor bug fixes around operations that require mutability.\r\n* Replacing an incorrect identity function with std::identity{}\r\n* Removed unnecessary moves.\r\n","verified_at":"2024-11-07T16:47:51Z"}},"url":"https://api.github.com/repos/stlab/stlab/commits/bc092d5b7384f21dc63db366d2f14cb9ec41e83f","html_url":"https://github.com/stlab/stlab/commit/bc092d5b7384f21dc63db366d2f14cb9ec41e83f","comments_url":"https://api.github.com/repos/stlab/stlab/commits/bc092d5b7384f21dc63db366d2f14cb9ec41e83f/comments","author":{"login":"sean-parent","id":2279724,"node_id":"MDQ6VXNlcjIyNzk3MjQ=","avatar_url":"https://avatars.githubusercontent.com/u/2279724?v=4","gravatar_id":"","url":"https://api.github.com/users/sean-parent","html_url":"https://github.com/sean-parent","followers_url":"https://api.github.com/users/sean-parent/followers","following_url":"https://api.github.com/users/sean-parent/following{/other_user}","gists_url":"https://api.github.com/users/sean-parent/gists{/gist_id}","starred_url":"https://api.github.com/users/sean-parent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sean-parent/subscriptions","organizations_url":"https://api.github.com/users/sean-parent/orgs","repos_url":"https://api.github.com/users/sean-parent/repos","events_url":"https://api.github.com/users/sean-parent/events{/privacy}","received_events_url":"https://api.github.com/users/sean-parent/received_events","type":"User","user_view_type":"public","site_admin":false},"committer":{"login":"web-flow","id":19864447,"node_id":"MDQ6VXNlcjE5ODY0NDQ3","avatar_url":"https://avatars.githubusercontent.com/u/19864447?v=4","gravatar_id":"","url":"https://api.github.com/users/web-flow","html_url":"https://github.com/web-flow","followers_url":"https://api.github.com/users/web-flow/followers","following_url":"https://api.github.com/users/web-flow/following{/other_user}","gists_url":"https://api.github.com/users/web-flow/gists{/gist_id}","starred_url":"https://api.github.com/users/web-flow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/web-flow/subscriptions","organizations_url":"https://api.github.com/users/web-flow/orgs","repos_url":"https://api.github.com/users/web-flow/repos","events_url":"https://api.github.com/users/web-flow/events{/privacy}","received_events_url":"https://api.github.com/users/web-flow/received_events","type":"User","user_view_type":"public","site_admin":false},"parents":[{"sha":"c59cfaca42aeb883c7ec331918325584193c8f53","url":"https://api.github.com/repos/stlab/stlab/commits/c59cfaca42aeb883c7ec331918325584193c8f53","html_url":"https://github.com/stlab/stlab/commit/c59cfaca42aeb883c7ec331918325584193c8f53"}],"stats":{"total":77,"additions":33,"deletions":44},"files":[{"sha":"4756aefaf5b6db7474574a285d38d0d0c8bd4a94","filename":"README.md","status":"modified","additions":4,"deletions":11,"changes":15,"blob_url":"https://github.com/stlab/stlab/blob/bc092d5b7384f21dc63db366d2f14cb9ec41e83f/README.md","raw_url":"https://github.com/stlab/stlab/raw/bc092d5b7384f21dc63db366d2f14cb9ec41e83f/README.md","contents_url":"https://api.github.com/repos/stlab/stlab/contents/README.md?ref=bc092d5b7384f21dc63db366d2f14cb9ec41e83f","patch":"@@ -26,8 +26,7 @@ Release changelogs are listed in [CHANGES.md](CHANGES.md).\n \n ## Requirements\n \n-- A standards-compliant C++14, C++17, or C++20 compiler\n-- **Use with a compiler in C++14-compliant mode** requires Boost.Optional and Boost.Variant >= 1.74.0\n+- A standards-compliant C++17, C++20, or C++23 compiler\n - **Building** the library requires CMake 3.23 or later\n - **Testing or developing** the library requires Boost.Test >= 1.74.0\n \n@@ -41,16 +40,10 @@ for an introduction to this tool.\n 1. Create a build directory outside this library's source tree.  In this guide, we'll use a sibling\n    directory called `BUILD`.\n \n-2. If you are using the library in C++14-compliant mode or need to run the test suite, be sure you\n-   have the necessary parts of Boost >= 1.74.0 installed.  Linux distributions usually make a\n-   suitable version available through standard package managers.  On macOS or Linux, you can easilly\n-   install Boost using [Homebrew](https://brew.sh/).  To install Boost on Windows, you can use\n-   Boost's [binary installers](https://sourceforge.net/projects/boost/files/boost-binaries/).\n-\n-3. Install a version of CMake >= 3.23.  If you are on Debian or Ubuntu Linux you may need to use\n+1. Install a version of CMake >= 3.23.  If you are on Debian or Ubuntu Linux you may need to use\n    `snap` to find one that's new enough.\n \n-4. If you are using MSVC, you may need to set environment variables appropriately for your target\n+1. If you are using MSVC, you may need to set environment variables appropriately for your target\n    architecture by invoking `VCVARSALL.BAT` with an appropriate option.\n \n ### Configure\n@@ -65,7 +58,7 @@ cmake -S . -B ../BUILD -DCMAKE_BUILD_TYPE=# SEE BELOW\n but there are other options you may need to append in order to be successful.  Among them:\n \n * `-DCMAKE_BUILD_TYPE=`[`Release`|`Debug`] to build the given configuration (required unless you're using visual studio or another multi-config generator).\n-* `-DCMAKE_CXX_STANDARD=`[`14`|`17`|`20`|`23`] to build with compliance to the given C++ standard.\n+* `-DCMAKE_CXX_STANDARD=`[`17`|`20`|`23`] to build with compliance to the given C++ standard.\n * `-DBUILD_TESTING=OFF` if you only intend to build, but not test, this library.\n * `-DBoost_USE_STATIC_LIBS=TRUE` if you will be testing on Windows.\n "},{"sha":"0e24c470be1e0495592412525aa5a6eb4a2e5420","filename":"stlab/concurrency/await.hpp","status":"modified","additions":4,"deletions":2,"changes":6,"blob_url":"https://github.com/stlab/stlab/blob/bc092d5b7384f21dc63db366d2f14cb9ec41e83f/stlab%2Fconcurrency%2Fawait.hpp","raw_url":"https://github.com/stlab/stlab/raw/bc092d5b7384f21dc63db366d2f14cb9ec41e83f/stlab%2Fconcurrency%2Fawait.hpp","contents_url":"https://api.github.com/repos/stlab/stlab/contents/stlab%2Fconcurrency%2Fawait.hpp?ref=bc092d5b7384f21dc63db366d2f14cb9ec41e83f","patch":"@@ -99,8 +99,10 @@ T await(future<T> x) {\n     std::condition_variable condition;\n     bool flag{false};\n \n+    future<T> result;\n+\n     auto hold = std::move(x).recover(immediate_executor, [&](future<T>&& r) {\n-        x = std::move(r);\n+        result = std::move(r);\n         {\n             std::unique_lock<std::mutex> lock{m};\n             flag = true;\n@@ -136,7 +138,7 @@ T await(future<T> x) {\n \n #endif\n \n-    return detail::_get_ready_future<T>{}(std::move(x));\n+    return detail::_get_ready_future<T>{}(std::move(result));\n }\n \n namespace detail {"},{"sha":"63c7f432a3f799bb2ba71860fb7412395d710dbc","filename":"stlab/concurrency/default_executor.hpp","status":"modified","additions":1,"deletions":1,"changes":2,"blob_url":"https://github.com/stlab/stlab/blob/bc092d5b7384f21dc63db366d2f14cb9ec41e83f/stlab%2Fconcurrency%2Fdefault_executor.hpp","raw_url":"https://github.com/stlab/stlab/raw/bc092d5b7384f21dc63db366d2f14cb9ec41e83f/stlab%2Fconcurrency%2Fdefault_executor.hpp","contents_url":"https://api.github.com/repos/stlab/stlab/contents/stlab%2Fconcurrency%2Fdefault_executor.hpp?ref=bc092d5b7384f21dc63db366d2f14cb9ec41e83f","patch":"@@ -64,7 +64,7 @@ constexpr auto platform_priority(executor_priority p) {\n         case executor_priority::low:\n             return DISPATCH_QUEUE_PRIORITY_LOW;\n         default:\n-            assert(!\"Unknown value!\");\n+            assert(false && \"Unknown value!\");\n     }\n     return DISPATCH_QUEUE_PRIORITY_DEFAULT;\n }"},{"sha":"b355a778353a251aa59645b6f9a6e8f051e25fec","filename":"stlab/concurrency/future.hpp","status":"modified","additions":23,"deletions":29,"changes":52,"blob_url":"https://github.com/stlab/stlab/blob/bc092d5b7384f21dc63db366d2f14cb9ec41e83f/stlab%2Fconcurrency%2Ffuture.hpp","raw_url":"https://github.com/stlab/stlab/raw/bc092d5b7384f21dc63db366d2f14cb9ec41e83f/stlab%2Fconcurrency%2Ffuture.hpp","contents_url":"https://api.github.com/repos/stlab/stlab/contents/stlab%2Fconcurrency%2Ffuture.hpp?ref=bc092d5b7384f21dc63db366d2f14cb9ec41e83f","patch":"@@ -15,6 +15,7 @@\n #include <atomic>\n #include <cassert>\n #include <exception>\n+#include <functional>\n #include <initializer_list>\n #include <memory>\n #include <mutex>\n@@ -567,34 +568,28 @@ class packaged_task {\n     packaged_task() = default;\n \n     ~packaged_task() {\n-        auto p = _p.lock();\n-        if (p) p->remove_promise();\n+        if (auto p = _p.lock()) p->remove_promise();\n     }\n \n     packaged_task(const packaged_task& x) : _p(x._p) {\n-        auto p = _p.lock();\n-        if (p) p->add_promise();\n+        if (auto p = _p.lock()) p->add_promise();\n     }\n \n     packaged_task(packaged_task&&) noexcept = default;\n-    packaged_task& operator=(const packaged_task& x) {\n-        auto tmp = x;\n-        *this = std::move(tmp);\n-        return *this;\n-    }\n+\n+    packaged_task& operator=(const packaged_task& x) { return *this = packaged_task{x}; }\n+\n     packaged_task& operator=(packaged_task&& x) noexcept = default;\n \n     template <typename... A>\n     void operator()(A&&... args) const noexcept {\n-        auto p = _p.lock();\n-        if (p) (*p)(std::forward<A>(args)...);\n+        if (auto p = _p.lock()) (*p)(std::forward<A>(args)...);\n     }\n \n     bool canceled() const { return _p.expired(); }\n \n     void set_exception(std::exception_ptr error) const {\n-        auto p = _p.lock();\n-        if (p) p->set_error(std::move(error));\n+        if (auto p = _p.lock()) p->set_error(std::move(error));\n     }\n };\n \n@@ -636,7 +631,7 @@ class STLAB_NODISCARD() future<T, enable_if_copyable<T>> {\n \n     template <typename F>\n     auto then(F&& f) const& {\n-        return recover([_f = std::forward<F>(f)](future<result_type>&& p) {\n+        return recover([_f = std::forward<F>(f)](future<result_type>&& p) mutable {\n             return std::move(_f)(*std::move(p).get_try());\n         });\n     }\n@@ -649,7 +644,7 @@ class STLAB_NODISCARD() future<T, enable_if_copyable<T>> {\n     template <typename E, typename F>\n     auto then(E&& executor, F&& f) const& {\n         return recover(std::forward<E>(executor),\n-                       [_f = std::forward<F>(f)](future<result_type>&& p) {\n+                       [_f = std::forward<F>(f)](future<result_type>&& p) mutable {\n                            return std::move(_f)(*std::move(p).get_try());\n                        });\n     }\n@@ -781,7 +776,7 @@ class STLAB_NODISCARD() future<void, void> {\n \n     template <typename F>\n     auto then(F&& f) const& {\n-        return recover([_f = std::forward<F>(f)](future<result_type>&& p) {\n+        return recover([_f = std::forward<F>(f)](future<result_type>&& p) mutable {\n             std::move(p).get_try();\n             return std::move(_f)();\n         });\n@@ -795,7 +790,7 @@ class STLAB_NODISCARD() future<void, void> {\n     template <typename E, typename F>\n     auto then(E&& executor, F&& f) const& {\n         return recover(std::forward<E>(executor),\n-                       [_f = std::forward<F>(f)](future<result_type>&& p) {\n+                       [_f = std::forward<F>(f)](future<result_type>&& p) mutable {\n                            (void)std::move(p).get_try();\n                            return std::move(_f)();\n                        });\n@@ -1244,7 +1239,7 @@ struct make_when_any {\n         using result_t = detail::result_t<F, T, size_t>;\n \n         auto shared = std::make_shared<detail::when_any_shared<sizeof...(Ts) + 1, T>>();\n-        auto p = package<result_t()>(executor, [_f = std::move(f), _p = shared] {\n+        auto p = package<result_t()>(executor, [_f = std::move(f), _p = shared]() mutable {\n             return detail::apply_when_any_arg(_f, _p);\n         });\n         shared->_f = std::move(p.first);\n@@ -1264,7 +1259,7 @@ struct make_when_any<void> {\n         using result_t = detail::result_t<F, size_t>;\n \n         auto shared = std::make_shared<detail::when_any_shared<sizeof...(Ts), void>>();\n-        auto p = package<result_t()>(executor, [_f = std::forward<F>(f), _p = shared] {\n+        auto p = package<result_t()>(executor, [_f = std::forward<F>(f), _p = shared]() mutable {\n             return detail::apply_when_any_arg(_f, _p);\n         });\n         shared->_f = std::move(p.first);\n@@ -1566,7 +1561,7 @@ struct _reduce_coroutine : std::enable_shared_from_this<_reduce_coroutine<P, R>>\n                                              _this->_promise.set_exception(e);\n                                              return;\n                                          }\n-                                         _this->stage_0(std::move(a));\n+                                         _this->stage_0(std::forward<decltype(a)>(a));\n                                      });\n     }\n     void stage_0(future<future<R>>&& r) {\n@@ -1672,12 +1667,13 @@ auto async(E executor, F&& f, Args&&... args)\n     using result_type = detail::result_t<std::decay_t<F>, std::decay_t<Args>...>;\n \n     auto p = package<result_type()>(\n-        executor, std::bind<result_type>(\n-                      [_f = std::forward<F>(f)](\n-                          unwrap_reference_t<std::decay_t<Args>>&... args) mutable -> result_type {\n-                          return _f(move_if<!is_reference_wrapper_v<std::decay_t<Args>>>(args)...);\n-                      },\n-                      std::forward<Args>(args)...));\n+        executor,\n+        std::bind<result_type>(\n+            [_f = std::forward<F>(f)](\n+                unwrap_reference_t<std::decay_t<Args>>&... args) mutable -> result_type {\n+                return std::move(_f)(move_if<!is_reference_wrapper_v<std::decay_t<Args>>>(args)...);\n+            },\n+            std::forward<Args>(args)...));\n \n     executor(std::move(p.first));\n \n@@ -1813,9 +1809,7 @@ struct std::coroutine_traits<stlab::future<T>, Args...> {\n         std::pair<stlab::packaged_task<T>, stlab::future<T>> _promise;\n \n         promise_type() {\n-            _promise = stlab::package<T(T)>(stlab::immediate_executor, [](auto&& x) -> decltype(x) {\n-                return std::forward<decltype(x)>(x);\n-            });\n+            _promise = stlab::package<T(T)>(stlab::immediate_executor, std::identity{});\n         }\n \n         stlab::future<T> get_return_object() { return std::move(_promise.second); }"},{"sha":"4671146958c714a9a7f7b5c93a2b12a19637a386","filename":"stlab/concurrency/system_timer.hpp","status":"modified","additions":1,"deletions":1,"changes":2,"blob_url":"https://github.com/stlab/stlab/blob/bc092d5b7384f21dc63db366d2f14cb9ec41e83f/stlab%2Fconcurrency%2Fsystem_timer.hpp","raw_url":"https://github.com/stlab/stlab/raw/bc092d5b7384f21dc63db366d2f14cb9ec41e83f/stlab%2Fconcurrency%2Fsystem_timer.hpp","contents_url":"https://api.github.com/repos/stlab/stlab/contents/stlab%2Fconcurrency%2Fsystem_timer.hpp?ref=bc092d5b7384f21dc63db366d2f14cb9ec41e83f","patch":"@@ -224,7 +224,7 @@ class system_timer {\n     [[deprecated(\"Use chrono::duration as parameter instead\")]] void operator()(\n         std::chrono::steady_clock::time_point when, F&& f) {\n         using namespace std::chrono;\n-        operator()(when - steady_clock::now(), std::move(f));\n+        operator()(when - steady_clock::now(), std::forward<decltype(f)>(f));\n     }\n \n     template <typename F, typename Rep, typename Per = std::ratio<1>>"}]}