Replace SFINAE with concepts (#5361)

Concepts are cleaner to use and result in much better error messages for incorrect template use.
This commit is contained in:
Tyler Veness
2023-06-07 09:50:09 -07:00
committed by GitHub
parent d57d1a4598
commit 91cbcea841
42 changed files with 397 additions and 361 deletions

View File

@@ -15,6 +15,7 @@
#include <utility>
#include <vector>
#include <wpi/concepts.h>
#include <wpi/future.h>
#include <wpi/mutex.h>
@@ -127,7 +128,7 @@ class AsyncFunction<R(T...)> final
auto loop = m_loop.lock();
if (loop->IsClosing()) {
if constexpr (std::is_same_v<R, void>) {
if constexpr (std::same_as<R, void>) {
return m_promises.MakeReadyFuture();
} else {
return m_promises.MakeReadyFuture({});