Skip to content

[libc++] Simplify std::function further after removing allocator support #144443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

philnik777
Copy link
Contributor

@philnik777 philnik777 commented Jun 16, 2025

Since we've removed allocator support, we can remove a few support structures. This only affects the policy implementation, so this shouldn't even be ABI sensitive.

Copy link

github-actions bot commented Jun 16, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff HEAD~1 HEAD --extensions h -- libcxx/include/__functional/function.h
View the diff from clang-format here.
diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h
index f0c00c56c..dc112ebfd 100644
--- a/libcxx/include/__functional/function.h
+++ b/libcxx/include/__functional/function.h
@@ -456,7 +456,7 @@ public:
   template <class _Fp, __enable_if_t<!is_same<__decay_t<_Fp>, __policy_func>::value, int> = 0>
   _LIBCPP_HIDE_FROM_ABI explicit __policy_func(_Fp&& __f) : __policy_(__policy::__create_empty()) {
     if (__function::__not_null(__f)) {
-      __func_ = __call_func<_Fp>;
+      __func_   = __call_func<_Fp>;
       __policy_ = __policy::__create<_Fp>();
       if (__use_small_storage<_Fp>()) {
         ::new ((void*)&__buf_.__small) _Fp(std::move(__f));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant