use std::move_only_function

Since enabling C++23, we can eliminate the need for `function2` and
instead leverage `std::move_only_function`.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iafc70c918e38b429e586bf18f71a716bdede43f8
diff --git a/meson.build b/meson.build
index b78f5dc..07ded48 100644
--- a/meson.build
+++ b/meson.build
@@ -85,17 +85,6 @@
   CLI11_dep = dependency('CLI11')
 endif
 
-if cpp.has_header_symbol('function2/function2.hpp', 'fu2::unique_function')
-  function2_dep = declare_dependency()
-else
-  subproject('function2')
-  function2_dep = declare_dependency(
-    include_directories: [
-      'subprojects/function2/include/function2'
-    ]
-  )
-endif
-
 if get_option('oe-sdk').enabled()
   # Setup OE SYSROOT
   OECORE_TARGET_SYSROOT = run_command('sh', '-c', 'echo $OECORE_TARGET_SYSROOT').stdout().strip()
@@ -157,7 +146,6 @@
   link_with: libpldmutils)
 
 deps = [
-  function2_dep,
   libpldm_dep,
   libpldmutils,
   nlohmann_json,
diff --git a/requester/handler.hpp b/requester/handler.hpp
index 1f29b3d..b03e05d 100644
--- a/requester/handler.hpp
+++ b/requester/handler.hpp
@@ -8,7 +8,6 @@
 #include <libpldm/pldm.h>
 #include <sys/socket.h>
 
-#include <function2/function2.hpp>
 #include <phosphor-logging/lg2.hpp>
 #include <sdbusplus/timer.hpp>
 #include <sdeventplus/event.hpp>
@@ -16,6 +15,7 @@
 
 #include <cassert>
 #include <chrono>
+#include <functional>
 #include <memory>
 #include <tuple>
 #include <unordered_map>
@@ -60,7 +60,7 @@
     }
 };
 
-using ResponseHandler = fu2::unique_function<void(
+using ResponseHandler = std::move_only_function<void(
     mctp_eid_t eid, const pldm_msg* response, size_t respMsgLen)>;
 
 /** @class Handler
diff --git a/subprojects/function2.wrap b/subprojects/function2.wrap
deleted file mode 100644
index 096a1d2..0000000
--- a/subprojects/function2.wrap
+++ /dev/null
@@ -1,3 +0,0 @@
-[wrap-git]
-url = https://github.com/Naios/function2
-revision = master