From aed09c41b6ea3d58ddb27e65fcfd5b781b8b3dcd Mon Sep 17 00:00:00 2001 From: Alberto La Rocca Date: Fri, 13 Dec 2024 16:56:28 +0100 Subject: [PATCH] Fix SFINAE on `gsl::owner`. (#1174) `std::enable_if_t` must not be used as a default template argument, otherwise the instantiator will be able to override it freely with something that doesn't fail substitution. Instead, `std::enable_if_t` itself must be the type of the template argument. More information in the examples here: https://en.cppreference.com/w/cpp/types/enable_if --- include/gsl/pointers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gsl/pointers b/include/gsl/pointers index 63e193e9..dd0f0682 100644 --- a/include/gsl/pointers +++ b/include/gsl/pointers @@ -75,7 +75,7 @@ using std::unique_ptr; // T must be a pointer type // - disallow construction from any type other than pointer type // -template ::value>> +template ::value, bool> = true> using owner = T; //