pw_function: Make constexpr constructible

This makes pw::Function usable in classes with constexpr constructors
and makes it compatible with constinit.

Change-Id: Iba20a6e2973f2488ab767bf0aafa99bf47f5ec2e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/50361
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
diff --git a/pw_function/function_test.cc b/pw_function/function_test.cc
index f76181c..fcc222d 100644
--- a/pw_function/function_test.cc
+++ b/pw_function/function_test.cc
@@ -15,10 +15,14 @@
 #include "pw_function/function.h"
 
 #include "gtest/gtest.h"
+#include "pw_polyfill/language_feature_macros.h"
 
 namespace pw {
 namespace {
 
+// Ensure that Function can be constant initialized.
+[[maybe_unused]] PW_CONSTINIT Function<void()> can_be_constant_initialized;
+
 int Multiply(int a, int b) { return a * b; }
 
 TEST(Function, OperatorCall) {