Skip to content

Commit aed09c4

Browse files
authored
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
1 parent 4b190d2 commit aed09c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/gsl/pointers

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ using std::unique_ptr;
7575
// T must be a pointer type
7676
// - disallow construction from any type other than pointer type
7777
//
78-
template <class T, class = std::enable_if_t<std::is_pointer<T>::value>>
78+
template <class T, std::enable_if_t<std::is_pointer<T>::value, bool> = true>
7979
using owner = T;
8080

8181
//

0 commit comments

Comments
 (0)