Skip to content

Commit f0899ff

Browse files
[NFC][SYCL] Modernize (idiomatic C++17) SingleNontypePropertyValueBase (#16128)
1 parent 39483ab commit f0899ff

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

sycl/include/sycl/ext/oneapi/properties/property_value.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,11 @@ inline namespace _V1 {
1717
namespace ext::oneapi::experimental {
1818
namespace detail {
1919

20-
// Checks if a type T has a static value member variable.
21-
template <typename T, typename U = int> struct HasValue : std::false_type {};
22-
template <typename T>
23-
struct HasValue<T, decltype((void)T::value, 0)> : std::true_type {};
24-
2520
// Base class for property values with a single non-type value
2621
template <typename T, typename = void> struct SingleNontypePropertyValueBase {};
2722

2823
template <typename T>
29-
struct SingleNontypePropertyValueBase<T, std::enable_if_t<HasValue<T>::value>> {
24+
struct SingleNontypePropertyValueBase<T, std::void_t<decltype(T::value)>> {
3025
static constexpr auto value = T::value;
3126
};
3227

0 commit comments

Comments
 (0)