util/cexec: Use concepts
Change-Id: If6277ca3e506b05ddfa97cde3b2f446f643502ea
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/include/stdplus/util/cexec.hpp b/include/stdplus/util/cexec.hpp
index a40903e..5a0de16 100644
--- a/include/stdplus/util/cexec.hpp
+++ b/include/stdplus/util/cexec.hpp
@@ -1,4 +1,5 @@
#pragma once
+#include <concepts>
#include <functional>
#include <string>
#include <system_error>
@@ -118,9 +119,8 @@
* @param[in] error - The numeric system error code
* @param[in] fun - the function used to throw the error
*/
-template <typename Fun>
-inline std::enable_if_t<std::is_invocable_v<Fun, int>, void> doError(int error,
- Fun&& fun)
+template <std::invocable<int> Fun>
+inline void doError(int error, Fun&& fun)
{
fun(error);
}